|
Subject: [xsl] simple (hopefully) document function question From: Cindy Girard <clm6u@xxxxxxxxxxxx> Date: Mon, 12 Sep 2005 19:31:13 -0400 |
Hi,
I apologize for the length of the post, but I'm trying to be
thorough:
I've been trying to retrieve some data from an outside XML document,
and I'm failing miserably.
It seems that I can get the text of the file (which is in the file
only as a debugging device), but cannot access anything
structurally.
Any help would be appreciated. And thank you in advance.
Here's a snip of the outside file:
-------------------------------
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<test>HELLO</test>
<system systemId="cbcbama" uri="media/childrn/cbcbama.xml">hi</system>
<system systemId="cbcbamb" uri="media/childrn/cbcbamb.xml">hi</system>
<system systemId="cbcbanoa" uri="media/childrn/cbcbanoa.xml">hi</system>
<system systemId="cbcbanob" uri="media/childrn/cbcbanob.xml">hi</system>
</catalog>
-------------------------------
Here are the relevant stylesheet sections:
-------------------------------
<xsl:variable name="utccat" select="document('c:\webserver\utc\xsl\utccat.xml', /)"/>
<xsl:template match="/">
<p><xsl:value-of select="$utccat"/></p>
<p><xsl:for-each select="document('utccat.xml')/catalog/system">
<xsl:value-of select="@systemID"/>
</xsl:for-each> </p>
</xsl:template>
<xsl:template match="div1">
<xsl:param name="thisid"><xsl:value-of select="ancestor::tei.2/@id"/></xsl:param>
<xsl:variable name="doc-name"><xsl:value-of select="document('utccat.xml')//system[@systemID=$thisid]/@uri"/></xsl:variable>
<xsl:variable name="doc-name2"><xsl:value-of select="document('utccat.xml')/catalog/system[@systemID=$thisid]"/></xsl:variable>
<xsl:variable name="testing123"><xsl:for-each select="document('utccat.xml')//system">
<xsl:value-of select="@systemID" />
<xsl:value-of select="@uri" />
</xsl:for-each></xsl:variable>
<p>TESTINGidHERE: <xsl:value-of select="$thisid"/></p>
<p>TESTINGid2HERE: <xsl:value-of select="$doc-name2"/></p>
<p>TESTINGfileHERE: <xsl:value-of select="$utccat//test"/></p>
<p>TESTINGfile2HERE: <xsl:value-of select="$utccat/catalog/test"/></p>
<p>TESTINGHERE: <xsl:value-of select="$doc-name"/></p>
<p>TESTING123HERE: <xsl:value-of select="$testing123"/></p>
</xsl:template>
-------------------------------
Here are my results:
-------------------------------
<p>
HELLO
hi
hi
hi
hi
</p>
<p></p>
<p xmlns:saxon="http://icl.com/saxon">TESTINGidHERE: cbcbama</p>
<p xmlns:saxon="http://icl.com/saxon">TESTINGid2HERE: </p>
<p xmlns:saxon="http://icl.com/saxon">TESTINGfileHERE: </p>
<p xmlns:saxon="http://icl.com/saxon">TESTINGfile2HERE: </p>
<p xmlns:saxon="http://icl.com/saxon">TESTINGHERE: </p>
<p xmlns:saxon="http://icl.com/saxon">TESTING123HERE: </p>
-------------------------------
Thanks,
-----
- Cindy
Cynthia M. Girard
IATH, University of Virginia
clm6u@xxxxxxxxxxxx
"Danger? I laugh in the face of danger!
...and then I hide until it goes away."
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Preserve some tags, but i, omprakash . v | Thread | Re: [xsl] simple (hopefully) docume, Jay Bryant |
| [xsl] Preserve some tags, but ignor, Matthew Fonda | Date | RE: [xsl] QUESTION, bryan . s . schnabel |
| Month |