ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> xsl-list
xsl-list
RE: [xsl] Xml to Xml
by Michael Kay other posts by this author
Oct 31 2003 1:13PM messages near this date
[xsl] Xml to Xml | RE: [xsl] Re: Re: Re: Converting specific child elements into att riutes of parent
Write an identity template rule that copies elements:

<xsl:template match="*"> 
<xsl:copy> 
<xsl:copy-of select="@*"/> 
<xsl:apply-templates/> 
</xsl:copy> 
</xsl:template> 

And an empty template rule that skips the others:

<xsl:template match="V|U"/> 

Michael Kay

>  -----Original Message-----
>  From: owner-xsl-list@[...].com 
>  [mailto:owner-xsl-list@[...].com] On Behalf Of 
>  poppe chris
>  Sent: 31 October 2003 12:20
>  To: XSL-List@[...].com
>  Subject: [xsl] Xml to Xml
>  
>  
>  
>  
>  Hello i want to converse an xml doc to an other one but 
>  leaving out some 
>  elements, ive tried several ways but it just wont work,
>  
>  here's what the original xml looks like
>  <?xml version="1.0"?>
>  <Bitstream xml:base="../CONTENT/final.yuv" 
>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="YUV" 
>  xmlns:yuv="YUV" xsi:schemaLocation="YUV 
>  file:/D:/school/DIA-BSDL-1%5B1%5D.1/DELIVERY_2003_08_13/BSDLSo
urce/../CONTENT/SCHEMAS/YUV.xsd"> 
	<Frame> 
		<Y> 
			<Ysample> 0 811008</Ysample>
		</Y> 
		<V> 
			<Vsample> 811008 405504</Vsample>
		</V> 
		<U> 
			<Usample> 1216512 405504</Usample>
		</U> 
	</Frame> 
	<Frame> 
		<Y> 
			<Ysample> 1622016 811008</Ysample>
		</Y> 
		<V> 
			<Vsample> 2433024 405504</Vsample>
		</V> 
		<U> 
			<Usample> 2838528 405504</Usample>
		</U> 
	</Frame> 
</Bitstream> 

now i want the same but withouth the V and U elements and their children

thus something like
<Bitstream ...> 
  <Frame> 
     <Y>    <Ysample>...</Ysample></Y>
  </Frame> 
  ...
</Bitstream> 

thanks in advance,
Chris

_________________________________________________________________
Volg Expeditie Robinson op de voet! 
http://entertainment.msn.be/tv/expeditierobinson/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
Thread:
poppe chris
Michael Kay

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved