document() Function and Fragment Identifiers
Mark Gannon <[email protected]>
| Newsgroups | gmane.comp.gnome.lib.xslt |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I'm working on an xsl implementation that requires retrieving documents over
the network using fragment identifiers. By fragment identifiers I mean URLs
that look like:
http://www.truenorth.nu/goodstuff.xml#moregood
In this example everything after the "#" is the identifier for a node (e.g. an
attribute where id="moregood"). From reading the documentation for libxslt
and xsl (Tidwell's book) my understanding is that this should return the node
with the "moregood" id and any children the node might have.
Is this an accurate understanding of how this should work?
If my understanding of how fragment identifiers should work is accurate, the
following example is returning a null or empty set for a URL when using a
fragment ID when I would expect to get a node set based on the id:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="yes" />
<xsl:variable name="mainTree"
select="document('http://taxonomies.xbrl.us/us-gaap/2009/elts/us-
gaap-2009-01-31.xsd#us-
gaap_OtherComprehensiveIncomeLossNetOfTaxPortionAttributableToParent')" />
<!--
<xsl:variable name="mainTree" select="document('http://taxonomies.xbrl.us/us-
gaap/2009/elts/us-gaap-2009-01-31.xsd')" />
-->
<xsl:template match="/">
<xsl:if test="not($mainTree)">
Maintree is empty
</xsl:if>
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
Being new to xslt and xsltproc I may have misunderstood how this should work,
but after examining all of the documentation and several books on the subject,
it seems like this should work.
Thanks in advance for your assistance.
Regards,
Mark Gannon
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt
signature.asc
(application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (GNU/Linux) iEYEABECAAYFAkzpsvgACgkQcDtGkR4u3fZqVQCfT9OftavFdrw1c4D3Tyxbh5So 3n4Anj9O6ZShG3opQylsPHv1EInjWK3A =+YbX -----END PGP SIGNATURE-----