>
Apologies for responding to myself, but maybe an example might help
(inline below)
>>
>> Hi again,
>>
>> I see the default ContentHandler implementation does not handle XML
>> Namespaces. Is that the case or does the :xmlns symbol
>
> I meant keyword (I think) here. For example, say I have /xml/ like:
>
> {:tag :my-root, attrs {:xmlns:x "http://www.w3.org/1999/
> xhtml", :xmlns:o "http://other/ns"}, content[
> {:tag :x:input}
> {:tag :o:something}
> ]}
>
> Is there some awareness in clojure code that manipulates/reads these
> collections that one child belongs to one namespace and the other
> belongs to the other namespace?
For example, a common scenario in XSL might be to perform an identity
transform on elements in the XHTML namespace and handle other
namespaced items as needed:
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0"
xmlns:x="http://www.w3.org/1999/xhtml"
xmlns:o="other/ns">
<!-- match document node and start traversing the tree -->
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<!-- match everything in the xhtml namespace and copy the element -->
<xsl:template match="x:*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- default attribute match just copies -->
<xsl:template match="@*">
<xsl:copy-of select="."/>
</xsl:template>
<!-- special handling of the something element in the other
namespace -->
<xsl:template match="o:something">
handle in some desired way...
</xsl:template>
</xsl:stylesheet>
>
>
> thanks,
> -Rob
>
>> provide some
>> meaning to the (nested) collection(s)? Is there such a thing as
>> namespacing a collection that would be based on the xmlns?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---