[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: jdgarrett@xxxxxxxxxx
Date: Sun, 16 Sep 2001 13:53:28 -0500
lt vb
Julian (and thanks again Chris )

Julian problem (which Chris has enlightened me about,)
is I want the value of the attribute or the element
before transformation so that it can be inserted into
another xml structure so that new xml structure is
"loadable" by the dom via visual basic..."without"
having to do the string manipulation that Chris
provided in his first reply .....this way new
xml and subsequent xml structures can be loaded
in the dom via visual basic and passed around
between vb COM objects until the final xml
structure is transformed via the transformnode
method in vb and sent out to the requesting browser
as HTML ....

the issue is keeping and accessing the value   < (or other character
entities) in their untransformed state (whether as an attribute value
or a node value) when passing between vb COM objects without
having to resort to additional string manipulations....

I have a simple vb function that will detransform a node or
attribute value when the submitting browser submits a html form...
using a simple replace function
e.g.

Function Detransform(submittedString) as string
	submittedString = replace(submittedString, "<", "&lt;)
	submittedString = replace(submittedString, ">", "&gt;)
	submittedString = replace(submittedString, "&", "&amp;)
	submittedString = replace(submittedString, "'", "&apos;)
	submittedString = replace(submittedString, """","&quot;)
	Detransform = submittedString
End Function


now after the destransform occurs I did not want to have
to run the xml through the above again every time the
xml structure was loaded by the MSXML parser inside of
all the vb COM objects that handle the XML structure on
the way to the SQL db and back up the vb COM chain
to the vb IIS application that does the final
transformation into HTML and then response.write
it out to the requesting browser...

Now that Chris has informed me that it is not possible to
access only the value rather than the value and the attribute
name via MSXML from visual basic I will have to call
the Detransform function every time the xml structure
is loaded and the attribute value is accessed ...

given (again)

<Customer  number="125487"   NumberOfPurchases="&lt;4" >Joe &amp; Bill's
Shop</Customer>

It would be nice if the Detransform function was a native
method inside the MSXML parser so that I could just access
the detransformed value of the attribute ..

dim stringDetransformedValue

stringDetransformedValue =
xml.selectSingleNode("/Customer/@NumberOfPurchases").xmlAttributeValueNotTra
nsformed

which would return only

&lt;4

rather than

NumberOfPurchases="&lt;4"


Bottom line ....

I must then have an external from parser function

given
<Customer  number="125487"   NumberOfPurchases="&lt;4" >Joe &amp; Bill's
Shop</Customer>

'//call vb function
result =
ReturnAttributeValueOnly(xml.selectSingleNode("/Customer/@NumberOfPurchases"
).xml)


Function ReturnAttributeValueOnly(ByVal stringPassedIn) As String
Dim string1 As String
Dim position1%, position2%
position1% = InStr(1, stringPassedIn, """", 1)
position2% = InStrRev(stringPassedIn, """")
ReturnAttributeValueOnly = Mid$(stringPassedIn, position1 + 1, position2 -
(position1 + 1))

End Function

the returned value would then be

&lt;4

Well that is that I guess ...(hey MS wanna put a new function in the MSXML
parser *s*)

Thanks again Chris ....!!!!!





|-----Original Message-----
|From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Chris Bayes
|Sent: Sunday, September 16, 2001 6:27 AM
|To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|Subject: RE:  How do you get the non-transformed character entity
|out of MSXML3.0
|
|
|Julian,
|Who knows what exactly the problem is here but suppose you wanted to do
|something like find all records in a text file that match some attribute
|in the dom. You can't do it. The text file might be a csv but with
|escaped characters who knows but there are times when you want to get
|"&lt;4" from the dom so that you can match it to a record in a text
|file. There is no way you can match a text record like
|125487    &lt;4     Joe &amp; Bill's Shop
|unless you can get the value "&lt;4" out of the dom.
|
|Ciao Chris
|
|XML/XSL Portal
|http://www.bayes.co.uk/xml
|
|
|> -----Original Message-----
|> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
|> Julian Reschke
|> Sent: 16 September 2001 11:04
|> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
|> Subject: RE:  How do you get the non-transformed
|> character entity out of MSXML3.0
|>
|>
|> Why would you want that?
|>
|> In XML, "less-than" is serialized as "&lt;".
|>
|> When accessing the DOM, you get the "raw" character ("<").
|>
|> Serializing the DOM again (using save() or the xml property)
|> will turn it back into "&lt;".
|>
|> I fail to see a problem here.
|
|
| 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.