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

RE: How do you get the non-transformed character entit

Subject: RE: How do you get the non-transformed character entity out of MSXML3.0
From: Nate Austin <naustin@xxxxxxxxxx>
Date: Wed, 19 Sep 2001 09:27:21 -0500
xpath get character
In that case, this is a bug in MSXML3.  It doesn't seem to return anything
if you use the browser to view it through XSLT, but if you do the following:

  doc:=CoDomDocument.Create;
  doc.load('tester.xml');
  node:=doc.selectSingleNode('/test/@attr/text()');
  edit1.text:=node.xml;

it returns '&lt;'.
As an aside, what is the reasoning behind attributes not having a single
text node child?

As stated in section 5.7 of the XPath 1.0 spec, "Characters inside comments,
processing instructions and attribute values do not produce text nodes."

It seems to me that XPath is lacking in this case.  Of those three, comments
are the only ones that end up only having text within them.  Attributes have
an expanded name and text, and processing instructions have a 'string value'
as defined by the spec, but also have what appear to be attributes (though
they aren't defined as such).
I'm sure this wasn't just done randomly, but I fail to see the logic in
this.  Why is XPath limited by its data model, etc. to not be able to select
just the text portion of these nodes?  Can someone please clue me in?
Thanks.

-Nate
naustin@idsgrp

P.S. Sorry for the misinformation.  One would have thought I'd have picked
that up in the last thousand or so digests and year and a half of XSLT work.
I guess it's time to re-read the specs and Mike's book.

> Date: Tue, 18 Sep 2001 21:42:04 +0100
> From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
> Subject: RE:  How do you get the non-transformed 
> character entity out of MSXML3.0
> 
> > If you modify your XPath statement to be
> > /somenode/@someattribute/text()
> 
> That means /child::somenode/attribute:someattribute/child::text().
> 
> An attribute never has children, so this will always return an empty
> node-set.
> 
> Mike Kay
> 
> 
>  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-2011 All Rights Reserved.