<< Back to previous view

[CONTRIB-104] prxml attribute value to support internal entity reference Created: 12/Feb/11  Updated: 18/Feb/11  Resolved: 18/Feb/11

Status: Closed
Project: Clojure-Contrib
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Enhancement Priority: Major
Reporter: Nevena Vidojevic Assignee: Stuart Sierra
Resolution: Declined Votes: 0
Labels: None


Now there is no way to support internal entities in xml, as value of attribute is always beings xml-escaped and '&' (used as part of entity reference) is being replaced with '&'.

Comment by Stuart Sierra [ 18/Feb/11 9:32 AM ]

The special tag :raw! is available for unescaped output.

Comment by Nevena Vidojevic [ 18/Feb/11 12:40 PM ]

Special tags are not considered for attribute value (prxml-attribute fn), just for xml tags (print-xml-tag multimethod), and when used string "[:raw! ...]" is printed as attribute value.

Comment by Stuart Sierra [ 18/Feb/11 1:05 PM ]

Yes. You must put the actual XML tag inside a [:raw! ...] block if you want to use XML entities in attributes.

Comment by Nevena Vidojevic [ 18/Feb/11 4:55 PM ]

I'll be more specific...
I made entity declaration in DOCTYPE like this:

<!ENTITY owl "http://www.w3.org/2002/07/owl#">

so I would be able to use reference to content of this named entity, using "&owl;" (XML syntax), for example:

<owl:onDatatype rdf:resource="&xsd;string">

I don't see a way to achieve this. My first thought was to use:

[:owl:onDatatype {:rdf:resource [:raw! "&xsd;string"]}]

Am I missing something?

Comment by Nevena Vidojevic [ 18/Feb/11 5:15 PM ]

Ah, ok, I can use:
[:raw! "<owl:onDatatype rdf:resource=\"&xsd;string\">"]
That seems a bit like a workaround.. I think more idiomatic way isn't so hard to achieve, but no need obviously..

Generated at Mon Oct 23 22:58:28 CDT 2017 using JIRA 4.4#649-r158309.