OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: question?

[ Lists Home | Date Index | Thread Index ]
  • From: "Mike Sharp" <msharp@lante.com>
  • To: "Michael O' Dell" <maod@hotmail.com>
  • Date: Thu, 15 Jun 2000 09:25:29 -0700

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...

Mike Sharp

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

To:   xml-dev@xml.org
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>
          some text....
               <link url attribute>some text....</link>
          some more text

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.



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


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS