Re: [xsl] simple (hopefully) document function question

Subject: Re: [xsl] simple (hopefully) document function question
From: "Jay Bryant" <jay@xxxxxxxxxxxx>
Date: Mon, 12 Sep 2005 21:17:19 -0500
Hi, Cindy,

Please specify the output you want. It's a bit tough to figure out what you
actually want for output from this message.

Also, you have two input documents (the one you are matching with match="/"
and the one (or is it two?) you are reading with the document function. It
would help to see the other input document, too.

It's best to post a small but complete set of input documents, stylesheet,
and desired output document. Don't worry too much about the length of your
post (but do try to create a sample problem that shows your issue as
succinctly as possible).

I'm sure we can work out a solution to your problem, but more detail would
speed along the process.

Jay Bryant
Bryant Communication Services

----- Original Message ----- 
From: "Cindy Girard" <clm6u@xxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, September 12, 2005 6:31 PM
Subject: [xsl] simple (hopefully) document function question


> 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:varia
ble>
>
> <xsl:variable name="doc-name2"><xsl:value-of
select="document('utccat.xml')/catalog/system[@systemID=$thisid]"/></xsl:var
iable>
>
>    <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