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

RE: question?

  • From: "Mike Sharp" <msharp@l...>
  • To: "Michael O' Dell" <maod@h...>
  • Date: Thu, 15 Jun 2000 09:25:29 -0700

michael o dell


Aha! Now I understand your question...The way I understand it (hopefully if I'm
wrong, somebody will set me straight), there are actually multiple text nodes
within the description.  Text nodes do not have delimiters in and of
themselves--they are contained within another element.  So in reality,
Description contains a substructure with three nodes:
1. Some Text
2. Link
3. Some More text

The xsl:value-of tag de-normalizes the text nodes into one node, by default.  In
fact, it's my understanding that if you programmatically removed the <link> tag
in the description element of a parsed XML document, you'd still have two text
nodes...even though you couldn't visually see where one starts and one ends.
The parser had them as separate nodes, and until you do something with them,
they remain separate. That's why text nodes are de-normalized by default with
the xsl:value-of.

The basic rule is, if the xsl pattern returns more than a single node, the
xsl:value-of element returns the text of the first node.  This is equivalent to
the XMLDOMNode object's selectSingleNode method. If the node returned is an
element with substructure, as in your case, xsl:value-of returns the
concatenated text nodes of that element's subtree with the markup removed.

That said, I would probably avoid just such a structure, if I could, because I
don't feel it's clear...

Regards,
Mike Sharp






"Michael O' Dell" <maod@h...> on 06/15/2000 07:46:01 AM

To:   xml-dev@x...
cc:    (bcc: Mike Sharp/Lante)

Subject:  RE: question?




>Tom Passin replied:
>
>So, would you be specific about why and where you think it 'shouldn't
> >work'? What did you think would happen and why?  What actually >happens
>that is different?  Don't make us guess!
>

If you look at the original mail that I sent out, I have a <Link> tag under
the description tag. However, if you were to look at this structure in a
graphical form, this is what one is presented with:

<division attribute>
     <revenue>...</revenue>
     <growth>...</growth>
     <description>
          some text....
               <link url attribute>some text....</link>
          some more text
     </description>
<division>

To me, the <link> tag should go against the well formed idea of XML. Given
the presense of text, 'some text' within the <description> element,
shouldn't this tag be closed first, before opening the <link> tag?

I hope this makes my problem more understandable.

Again, thanks for any help / suggestions etc.

cheers,

Mike






***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.