[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

simple (hopefully) document function question

Subject: simple (hopefully) document function question
From: Cindy Girard <clm6u@xxxxxxxxxxxx>
Date: Mon, 12 Sep 2005 19:31:13 -0400
cindy girard
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.