Transform fails when xmlns namespace declaration present
Posted: Tue Sep 27, 2005 7:48 pm
I have a DSML document that declares a default namespace. When the xmlns attribute is present, the transform does not return the desired results. When I remove the attribute, the transform works as expected.
I am trying to learn what I am not understanding about the roll of the namespace declaration relative to what the transform process is needing.
The namespace declaration is present by default as I am using a binary DSML toolset distribution that always includes it. Note that the URL http://www.dsml.org/DSML returns a 404 as dsml.org is no longer maintained.
I appreciate any suggestions that help me understand how the namespace declaration is impacting this simple transform process.
The stylesheet is as follows:
Successful output:
I am trying to learn what I am not understanding about the roll of the namespace declaration relative to what the transform process is needing.
The namespace declaration is present by default as I am using a binary DSML toolset distribution that always includes it. Note that the URL http://www.dsml.org/DSML returns a 404 as dsml.org is no longer maintained.
I appreciate any suggestions that help me understand how the namespace declaration is impacting this simple transform process.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<dsml complete="false" xmlns="http://www.dsml.org/DSML">
<directory-entries>
<entry dn="dc=qua,dc=company,dc=com">
<objectclass>
<oc-value>top</oc-value>
<oc-value>domain</oc-value>
</objectclass>
<attr name="dc">
<value>qua</value>
</attr>
</entry>
<entry dn="cn=Directory Administrators, dc=qua,dc=company,dc=com">
<objectclass>
<oc-value>top</oc-value>
<oc-value>groupofuniquenames</oc-value>
</objectclass>
<attr name="cn">
<value>Directory Administrators</value>
</attr>
</entry>
<entry dn="ou=Groups, dc=qua,dc=company,dc=com">
<objectclass>
<oc-value>top</oc-value>
<oc-value>organizationalunit</oc-value>
</objectclass>
<attr name="ou">
<value>Groups</value>
</attr>
</entry>
<entry dn="ou=People, dc=qua,dc=company,dc=com">
<objectclass>
<oc-value>top</oc-value>
<oc-value>organizationalunit</oc-value>
</objectclass>
<attr name="ou">
<value>People</value>
</attr>
</entry>
</directory-entries>
</dsml>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="entry">
<dn>
<xsl:value-of select="./@dn"/>
</dn>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<dn>dc=qua,dc=company,dc=com</dn>
<dn>cn=Directory Administrators, dc=qua,dc=company,dc=com</dn>
<dn>ou=Groups, dc=qua,dc=company,dc=com</dn>
<dn>ou=People, dc=qua,dc=company,dc=com</dn>