Clojure-Contrib

prxml attribute value to support internal entity reference

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

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 '&'.

Activity

Hide
Stuart Sierra added a comment -

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

Show
Stuart Sierra added a comment - The special tag :raw! is available for unescaped output.
Hide
Nevena Vidojevic added a comment -

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.

Show
Nevena Vidojevic added a comment - 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.
Hide
Stuart Sierra added a comment -

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

Show
Stuart Sierra added a comment - Yes. You must put the actual XML tag inside a [:raw! ...] block if you want to use XML entities in attributes.
Hide
Nevena Vidojevic added a comment -

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

<!DOCTYPE rdf:RDF [
<!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?

Show
Nevena Vidojevic added a comment - I'll be more specific... I made entity declaration in DOCTYPE like this: <!DOCTYPE rdf:RDF [ <!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?
Hide
Nevena Vidojevic added a comment -

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..

Show
Nevena Vidojevic added a comment - 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..

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: