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

1 XSL for 2 XML

Subject: 1 XSL for 2 XML
From: Petr Mach3 <Mach3P@xxxxxxxxx>
Date: Tue, 01 Jun 2004 10:17:39 +0200 (CEST)
2 xml 1 xsl
Hi,
I need a little help. I have 2 XML and 2 XSL to view files in IE,
but I need only 1 XSL. Only SOAP header and namespaces is difference
between XML files.
Any help?
1. XML:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="mytab.xsl" ?>
<MYTAB>
 <MYHEAD>AAA</MYHEAD>
 <MYITEM>
    <MYIT>A1</MYIT>
 </MYITEM>
 <MYITEM>
    <MYIT>A2</MYIT>
 </MYITEM>
</MYTAB>
1.XSL mytab.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" version="4.0"/>
<xsl:template match="/">
<html><body>
<xsl:apply-templates select="MYTAB"/>
</body></html>
</xsl:template>
<xsl:template match="MYTAB">
<table border="1">
<th>HEAD</th><th><xsl:value-of select="MYHEAD"/></th>
<xsl:apply-templates select="MYITEM"/>
</table>
</xsl:template>
<xsl:template match="MYITEM">
<tr><td>ITEM</td><td><xsl:value-of select="MYIT"/></td></tr>
</xsl:template>
</xsl:stylesheet>
2. XML:
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='soap_mytab.xsl'?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
  </soap:Header>
  <soap:Body>
    <receivedocument xmlns="urn:schemas-cp-com:loc">
      <BodyDocuments>
	<MYTAB xmlns="urn:schemas-cp-com:gen">
	 <MYHEAD>AAA</MYHEAD>
	 <MYITEM>
	    <MYIT>A1</MYIT>
	 </MYITEM>
	 <MYITEM>
	    <MYIT>A2</MYIT>
	 </MYITEM>
	</MYTAB>
      </BodyDocuments>
    </receivedocument>
  </soap:Body>
</soap:Envelope>
2.XSL soap_mytab.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:d="urn:schemas-cp-com:loc"
xmlns:f="urn:schemas-cp-com:gen">
<xsl:output method="html" version="4.0"/>
<xsl:template match="/">
<html><body>
<xsl:apply-templates select="soap:Envelope/soap:Body/d:receivedocument/d:BodyDocuments/f:MYTAB"/>
</body></html>
</xsl:template>
<xsl:template match="f:MYTAB">
<table border="1">
<th>HEAD</th><th><xsl:value-of select="f:MYHEAD"/></th>
<xsl:apply-templates select="f:MYITEM"/>
</table>
</xsl:template>
<xsl:template match="f:MYITEM">
<tr><td>ITEM</td><td><xsl:value-of select="f:MYIT"/></td></tr>
</xsl:template>
</xsl:stylesheet>

____________________________________________________________
Internet Expres vám přináší nové možnosti zábavy - filmy, hudbu, hry, sport, to vše si budete na internetu užívat bez čekání, po celý den.
http://ad.seznam.cz/clickthru?spotId=74659&section=/

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.