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

RE: Get value from update.xml and stored in source.xm

Subject: RE: Get value from update.xml and stored in source.xml(update source.xml)
From: "Shailesh" <shailesh@xxxxxxxxxxxx>
Date: Wed, 8 Sep 2004 16:35:52 +0530
vb.net update xml file
Hi,

Using msxml 4.0
The Output is:

<?xml version="1.0" encoding="utf-16"?>
<test>
  <source.xml>
    <test>
      <chapter>
        <test1 id="0000001">
          <test2>
          </test2>
        </test1>
        <test1 id="0000002">
          <test2>
          </test2>
        </test1>
      </chapter>
    </test>
  </source.xml>
  <source.xml>
  </source.xml>
  <output>
    <test>
      <chapter>
        <test1 id="0000001">
          <!--Looking up test1 (id = '0000001')-->
          <!--With raw xpath:-->
          <!--With a key:-->
        </test1>
        <test1 id="0000002">
          <!--Looking up test1 (id = '0000002')-->
          <!--With raw xpath:-->
          <!--With a key:-->
        </test1>
      </chapter>
    </test>
  </output>

-----Original Message-----
From: Joris Gillis [mailto:roac@xxxxxxxxxx]
Sent: Thursday, September 08, 2005 3:40 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Get value from update.xml and stored in source.xml(update
source.xml)

On Wed, 08 Sep 2004 11:40:56 +0200, Shailesh <> wrote:

> I have used posted xml and xslt.
> I have written a small code in VB.NET which takes input as "xml" file
> and for transformation "xslt" and does the transformation which will
> output an xml file.


What version of msxml do you use?

Please run this diagnosing stylesheet and post the output.

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:strip-space elements="*"/>

<xsl:output method="xml" indent="yes"/>

<xsl:variable name="update" select="document('update.xml')"/> <xsl:key
name="id" match="*" use="@id"/>

<xsl:template match="/">
<test>
	<source.xml>
		<xsl:copy-of select="/"/>
	</source.xml>
	<source.xml>
		<xsl:copy-of select="$update"/>
	</source.xml>
	<output>
		<xsl:apply-templates/>
	</output>
</test>
</xsl:template>


<xsl:template match="*[@id]">
	<xsl:variable name="id" select="@id"/>
	<xsl:copy>
		<xsl:apply-templates select="@*" />
		<xsl:comment>Looking up <xsl:value-of
select="local-name()"/> (id = '<xsl:value-of select="@id"/>')</xsl:comment>
		<xsl:comment>With raw xpath:</xsl:comment>
		<xsl:copy-of select="$update//*[@id=$id]/*"/>
		<xsl:comment>With a key:</xsl:comment>
		<xsl:for-each select="$update">
			<xsl:copy-of select="key('id',$id)/*"/>
		</xsl:for-each>
	</xsl:copy>
</xsl:template>

<xsl:template match="node()|@*">
	<xsl:copy>
		<xsl:apply-templates select="node()|@*" />
	</xsl:copy>
</xsl:template>

</xsl:stylesheet>

--
"Em o_da |ti oud]m o_da"  - Syjqatgr

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.