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

RE: xpath problem

Subject: RE: xpath problem
From: cknell@xxxxxxxxxx
Date: Wed, 19 Nov 2003 11:28:12 -0500
xpath doctype
There isn't enough information here to get very far, but I noticed right away that

<VariablesMetadataVO type="VO" name="VariablesMetadataVO">
<VariablesMetadataVORow> <ArticleVersionId>101130763</ArticleVersionId>
<VariableCode>OKC$S_CURRENCY_NAME</VariableCode>
<VariableType>S</VariableType>
<DocType>QUOTE</DocType>
<ViewObjectName>HeaderVO</ViewObjectName>
<AttributeName>CurrencyName</AttributeName>
</VariablesMetadataVORow>
doesn't contain a <VariableName> element that your XPath expression is looking for as a child of <VariablesMetadataVORow>.
--
Charles Knell
cknell@xxxxxxxxxx - email




-----Original Message-----
From:     Aananth.S <aananth.solaiyappan@xxxxxxxxxx>
Sent:     Wed, 19 Nov 2003 21:11:29 +0530
To:       XSL-List@xxxxxxxxxxxxxxxxxxxxxx
Subject:   xpath problem

Hi all,


We have the following XML fragment.


<article> som text here <var name="OKC$S_CURRENCY_NAME" type="S" meaning="Currency Name" /> </article>
........
<VariablesMetadataVO type="VO" name="VariablesMetadataVO">
<VariablesMetadataVORow> <ArticleVersionId>101130763</ArticleVersionId>
<VariableCode>OKC$S_CURRENCY_NAME</VariableCode>
<VariableType>S</VariableType>
<DocType>QUOTE</DocType>
<ViewObjectName>HeaderVO</ViewObjectName>
<AttributeName>CurrencyName</AttributeName>
</VariablesMetadataVORow>
...............
<HeaderVO>
<HeaderVORow>
<CurrencyName>Dollars</CurrencyName>
</HeaderVORow>
</HeaderVO>
.........



And the following XSL tempalte to match the *var* tags.


<xsl:template match="var[@type='S']">
<xsl:variable name="system" select="//VariablesMetadataVO/VariablesMetadataVORow[VariableName=current()/@name]"/>
<xsl:value-of select="//descendant::[name(.)=$system/ViewObjectName]/descendant::[name(.)=$system/AttributeName]"/>


</xsl:template>

the result of applying the template should be some thing like

<article>som text here Dollars </article>


The var tag in the article text points to metadata which in turn points to the value that has to be substituted in place of the var tag.We are currently using the folowing Xpath .. but the parser fails as the XPath seems to be malformed. What are we missing here?Any suggesiotns for alternative XPaths?any help is highly appreciated.


TIA,
Aananth



--
<?xmlversion="1.0"?>
<Signature>
 <fname>aananth</fname>
 <lname>solaiyappan</lname>
 <position>ApplicationsEngineer</position>
 <contactinfo>
   <mail>aananth.solaiyappan@xxxxxxxxxx</mail>
   <phone>
     <office>+91-80-5108-4014</office>
     <cell>+91-80-3187-1944</cell>
   </phone>
 </contacinfo>
 <slogan>
 Don't tell GOD how big your storm is.
 Tell the storm how big your GOD is!
 </slogan>
</Signature>



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread
  • xpath problem
    • Aananth.S - Wed, 19 Nov 2003 10:40:54 -0500 (EST)
      • Ram - Wed, 19 Nov 2003 11:22:37 -0500 (EST)
      • <Possible follow-ups>
      • cknell - Wed, 19 Nov 2003 11:28:19 -0500 (EST) <=
      • Ryan Graham - Wed, 19 Nov 2003 15:04:42 -0500 (EST)

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.