Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] XSLT: Transforming one markup to another markup

From: "Michael Kay" <mike@------------>
To:
Date: 5/2/2006 8:56:00 AM
It's a good idea not just to describe your objective, but also to explain
where your difficulty lies. It's difficult to answer a question without
knowing something of your level of understanding of the language. There are
some people on this list who might respond with a complete worked solution,
but most of us prefer, I think, to work out where you're stuck, point you in
the right direction, and then leave you to solve the problem yourself. 

In this case, I'm afraid I can't reverse engineer the rules for the
transformation. You say:

> 2)In Y Markup--- always the last hierlev element contains two 
>  hierlev as children.

But that doesn't make sense. If the last hierlev element has two hierlev
children, then it's not the last hierlev element, because its children come
after it. 

Michael Kay
http://www.saxonica.com/



> -----Original Message-----
> From: Tedla, Sridhar (LNG-CSP) [mailto:Sridhar.Tedla@xxxxxxxxxxxxxx] 
> Sent: 02 May 2006 04:33
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] XSLT: Transforming one markup to another markup
> 
> Hi!
> The X markup needs to be converted into Y markup.
> The X markup is as follows:
> 
> 
> <class scheme="SAT"> 
>    <classitem> 
> 	 <identifier> 
> 		<name>Sales </name> 
>            	<code>1234</code> 
> 	 </identifier> 
> 	 <classitem> 
>  	   <identifier> 
> 		  <name> Tax</name> 
> 		  <code>5678</code> 
> 	   </identifier> 
> 	 <classitem> 
> 	   <identifier> 
> 		 <name>Items  </name> 
> 		 <code>9101</code> 
> 	   </identifier> 
> 	  <classitem> 
> 	     <identifier> 
> 		<name>Manufacturing </name> 
> 		<code>1121</code> 
> 	     </identifier> 
>            </classitem> 
> 	</classitem> 
>      </classitem> 
>     </classitem>
> </class> 
> 
> The Y Markup is has follows:
> 
> <hier>
>   <hierlev role="ancestor">
>      <heading>
> 	<title>Sales</title>
>      </heading>
> 
>      <hierlev role="ancestor">
>         <heading>
> 	   <title> Tax</title>
>          </heading>
> 
>          <hierlev role="ancestor">
> 	<heading>
>               <title>Items </title>
> 	</heading>
>             <hierlev role="ancestor">
> 	       <heading>
> 		  <title>Manufacturing </title>
> 	       </heading>
>                   <hierlev role="ancestor">
> 		   <heading>
> 			<title>Revised Code </title>
> 		    </heading>
> 	        </hierlev>
> 	        <hierlev role="me">
>     		    <heading>
> 			<title> Title Value</title>
> 		     </heading>
> 	         </hierlev>
> 	    </hierlev>
>           </hierlev>
>      </hierlev>
>    </hierlev>
> </hier>
> 
> Now two rules for the above conversion:
> 1)In X markup--The classitem depth is arbitary. 
> 2)In Y Markup--- always the last hierlev element contains two 
>  hierlev as children.
> 
> 
> Sridhar


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent