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

Re: Converting XML

  • To: tedd <tedd@s...>, xml-dev@l...
  • Subject: Re: Converting XML
  • From: Prakash Yamuna <techpy@y...>
  • Date: Tue, 28 Dec 2004 14:53:59 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=3qI6XGMAw3eGRmZjZhTqwZ6sHvUvGiX6ZI5A96dngDxjAx1LPLpNseHtUnN+W9wEN5l5js9CBjlYc+D6g/WkvHCeaO8ylHpeli6M3ElA0Epxlp0uor2gLMyjPRzx5dM/YyxDw1xLaqnWb0FWVFVq6piF+M7BJXY4a5YpF+mceGs= ;
  • In-reply-to: <p0620070bbdf785951a41@[192.168.0.100]>

xml to classes
Consider the following example:
<Book>
   <BookTitle>blah1</BookTitle>
   <Authors>
       <Author>blah2</Author>
       <Author>blah3</Author>
   </Authors>
</Book>
 
Now if you wanted to convert the above to:
<em class="Book">
   <em class="BookTitle">blah1</em>
   <em class="Authors">
       <em class="Author">blah2</em>
       <em class="Authror">blah3</em>
   </em>
</em>
 
 
Then with the first method you would have a template rule for "Book", "BookTitle", "Authors", "Author"
 
Instead you could perhaps write a generic template where it works for any element name...
 
Again I would stick with the first solution if the requirement is simple and it is a one-off scenario.
 
The more generic one is more applicable when you want to leverage the same xslt for xml documents independent of element names, etc.
So what I had in mind in terms of "scale" was pretty much the number of template rules you would have to write.
 
If you are new to XSLT then again you may be better off with the first solution it is simple and easy to implement and understand.
 
prakash
tedd <tedd@s...> wrote:
>If your requirement is more generic in that replace specific element
>names with a more generic for all element
>names, then solution provided below won't scale. You may want to use
>a more generic template instead...
>

prakash:

Thanks for the advice -- but, I'm not sure as to what "scale" means
in this problem.

Please understand that compared to most of the others on this list, I
flounder around the bottom of the geek scale.

tedd

ps: I wonder if anyone on this list knows where the term "geek" came from?
--
--------------------------------------------------------------------------------
http://sperling.com/

-----------------------------------------------------------------
The xml-dev list is sponsored by XML.org , an
initiative of OASIS

The list archives are at http://lists.xml.org/archives/xml-dev/

To subscribe or unsubscribe from this list use the subscription
manager:


Do you Yahoo!?
The http://my.yahoo.com ? What will yours do?

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.