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

Re: how to get the value ?

Subject: Re: how to get the value ?
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Wed, 31 May 2000 16:42:24 +0100
how to norton
==Off-Line==

Heather, 

Are you *sure* about this?

Isn't this (elements with both child elements and text nodes) simply
mixed-content as described in
http://www.w3.org/TR/REC-xml#sec-mixed-content ?

Not done much in the DP world, I admit, but a bit hard to implement
XHTML without it...

You may want to get your corrections in first!

Francis.



Heather Lindsay wrote:
> 
> " xml structure
> 
> <?xml version="1.0"?>
> <first>
>         <second> data1
>             <child att="x">data2</child>
>         </second>
> </first>
> 
> I want to fetch  the values "data1" and "data2" ."
> 
> The above is not well-formed XML because elements with child elements cannot
> also have a text element.  You could either have another child element with
> "data1" in it or set "data1" as the value of an attribute in your "second"
> element (<second attrib=data1>).  For learning XSLT, I strongly recommend
> THE book, "XSLT Programmer's Reference" by Mike Kay (published by Wrox).
> You will probably need to order the book online as it is still very new and
> not yet in very many book stores.
> 
> If your XML doc. was as follows:
> 
> <first>
>         <second>
>                 <child1> data1 </child1>
>             <child2 att="x">data2</child2>
>         </second>
> </first>
> 
> Then the following XSL would get the values you want:
> 
> <xsl:stylesheet  .............>
>         <xsl:template match="/">
>                 <HTML>
>                 <BODY>
>                         <p><xsl:value-of select="second/child1"/></p>
>                         <p><xsl:value-of select="second/child2"/></p>
>                 </BODY>
>                 </HTML>
>         </xsl:template>
> </xsl:stylesheet>
> 
> Producing the following HTML:
> 
> <HTML>
> <BODY>
>         <p> data1 </p>
>         <p> data2 </p>
> </BODY>
> </HTML>
> 
> Good luck,
> Heather
> 
>  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

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.