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

RE: More newbie questions

Subject: RE: More newbie questions
From: mylistaddress@xxxxxxxxxx
Date: Wed, 23 Mar 2005 03:04:03 -0800 (PST)
searchstatement
Hi,
OK, I have been kicking this around a little. In
regards to Michael Kay's note:

"> Depending where you are when you start, an
expression like
>
ancestor::Response/preceding-sibling::Database/@DatabaseName should do the
> trick."

Again, I am trying to make the value of
Database/@DatabaseName appear in each instance of the
DATA tag. This ancestor and sibling stuff has me in a
knot...

Here is the XML:

<Root>
<Database DatabaseName="ABC123" />
<Report DatabaseId="1">
	<SearchStatement>Canada</SearchStatement>
</Report>
<GetRecords>
<Response>
	<Record>
		<Field OutputFieldName="DOCI">EUP2050101000035</Field>
		<Field OutputFieldName="TOPIC">INTERNATIONAL
POLITICAL</Field>
		<Field OutputFieldName="DATE">2005 01 01</Field>
		<Field OutputFieldName="FDATE">2005 01 01</Field>
		<Field OutputFieldName="SS">THIS SHOULD NOT
APPEAR!</Field>
		<Field OutputFieldName="CNTRY">Denmark</Field>
		<Field OutputFieldName="CNTRY">Canada</Field>
		<Field OutputFieldName="DIVI">Europe</Field>
		<Field OutputFieldName="HEAD">Danish Daily Warns Not
to Expect Snow...!</Field>
		<Field OutputFieldName="TEXT">CALGARY (CP) - Deputy
P...</Field>
		</Field>
	</Record>
</Response>	
</GetRecords>
</Root>

Here is the XSL:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Record">
<xsl:element name="DATA">
	<xsl:element name="COLLECNAME">
		<xsl:value-of select="??????/Database/@DatabaseName"
/>
	</xsl:element>
	<xsl:apply-templates select="Field" />
</xsl:element>
</xsl:template>
<xsl:template match="Field">
	<xsl:element name="{@OutputFieldName}">
		<xsl:apply-templates  />
	</xsl:element>
</xsl:template>
</xsl:stylesheet>

-------------
Any help greatly appreciated!

JW

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.