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

Re: [xslt v1.0] How to parse the string as node-set?

Subject: Re: [xslt v1.0] How to parse the string as node-set?
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sun, 30 Sep 2012 07:36:11 -0700
Re: [xslt v1.0] How to parse the string as node-set?
Here is an example how to do this for a cspecific XSLT processor (.NET
XslCompiledTransform):

<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
 xmlns:ex="http://xmlexchangeservice.com/"
 xmlns:my="my:my" exclude-result-prefixes="msxsl my">
	<xsl:output omit-xml-declaration="yes" indent="yes"/>
	
	<xsl:template match="/*">
		<xsl:copy-of select=
		 "my:parse(string(//ex:InputXML))//*[local-name()='Organization']"/>
	</xsl:template>

	<msxsl:script language="c#" implements-prefix="my">
		public XmlDocument parse(string text)
		 {    XmlDocument doc = new XmlDocument();
		      doc.LoadXml(text);
		      return doc;
     }
	 </msxsl:script>
</xsl:stylesheet>


produces:

<tns:Organization
xmlns:tns="urn:schemas:x12:org:V00200806:CoverageRequest"
xmlns:X12.7="urn:x12:schemas:V00200806:X12.7"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<tns:Name>Florida</tns:Name>
</tns:Organization>


Cheers,
Dimitre

On Fri, Sep 28, 2012 at 1:19 PM, Mak Praveen <praveenml@xxxxxxxxx> wrote:
> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
>             <soap:Body>
>                         <TransmitXML xmlns="http://xmlexchangeservice.com/">
>                                     <InputXML>&lt;?xml version="1.0"
> encoding="utf-8"?&gt;
>                 &lt;tns:CoverageRequest
> xmlns:X12.7="urn:x12:schemas:V00200806:X12.7"
> xmlns:tns="urn:schemas:x12:org:V00200806:CoverageRequest"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> PublicationVersion="00200809" PublicationDate="1984-02-12"&gt;
>                     &lt;tns:RequestorInformation&gt;
>                         &lt;tns:Organization&gt;
>                             &lt;tns:Name&gt;Florida&lt;/tns:Name&gt;
>                         &lt;/tns:Organization&gt;
>                         &lt;tns:ReasonDetails&gt;
>                             &lt;tns:ReasonCode&gt;ACCV&lt;/tns:ReasonCode&gt;
>                         &lt;/tns:ReasonDetails&gt;
>                     &lt;/tns:RequestorInformation&gt;
>                 &lt;/tns:CoverageRequest&gt;
>         </InputXML>
>         <XMLSchemaVersion>V00200806-ServiceRequest</XMLSchemaVersion>
> </TransmitXML>
> </soap:Body>
> </soap:Envelope>



-- 
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
To avoid situations in which you might make mistakes may be the
biggest mistake of all
------------------------------------
Quality means doing it right when no one is looking.
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
-------------------------------------
Facts do not cease to exist because they are ignored.
-------------------------------------
Typing monkeys will write all Shakespeare's works in 200yrs.Will they
write all patents, too? :)
-------------------------------------
I finally figured out the only reason to be alive is to enjoy it.

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.