Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0
This is the forum to discuss the Wrox book XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition by Michael Kay; ISBN: 9780470192740
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition ISBN: 978-0-470-19274-0 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old November 20th, 2008, 02:22 PM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default html to xml convertion using xslt

I am new to this forums and new to the XSLT

Thanks for you support. Need help urgent.

we can translate xml to html using xsl, is it poseble to get reverse by using the same xsl? if so please tell me how ! or tell how easy way to get transelate html to xml.


input html file
===============

<html>
<body>
<div id="csResponse">
<h2><a name="csResponse">cs Response</a></h2>
<p>Para acontent 1111</p>

<h3><a name="vs11">Vulnerability Characteristics</a></h3>
<p> para content22222 </p>
<pre> clicode content 111 </pre>

<h3><a name="vs22">Vulnerability Characteristics</a></h3>
<p> para content22222 </p>
<pre> clicode content 2222</pre>

<h3><a name="vs33">Vulnerability Characteristics</a></h3>
<p> para content333 </p>
<pre> clicode content 3333</pre>
<p> para content3333333 </p>

</div>
</body>
</html>

Out put XML file
================
<Topic>
<Concept Title="csResponse">
<Para>Para acontent 1111</Para>
</Concept>

<Concept Title="vs11">
<Para><p> para content22222 </p></Para>
<CLICode> clicode content 111</CLICode>
</Concept>

<Concept Title="vs22">
<Para>Para acontent 1111</Para>
<CLICode> clicode content 2222</CLICode>
</Concept>

<Concept Title="vs33">
<Para>para content333</Para>
<CLICode> clicode content 3333</CLICode>
<Para> para content3333333 </Para>
</Concept>

</Topic>

Reply With Quote
  #2 (permalink)  
Old November 20th, 2008, 07:16 PM
mhkay's Avatar
Wrox Author
Points: 18,481, Level: 59
Points: 18,481, Level: 59 Points: 18,481, Level: 59 Points: 18,481, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,960
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If the HTML is well-formed (i.e. XHTML) then you can use XSLT to transform it. But of course it will need completely different XSLT code. And don't expect that every transformation is fully reversible - after all, you can compute 2+2=4, but you can't reverse that to convert 4 to 2+2.

Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer's Reference
Reply With Quote
  #3 (permalink)  
Old November 24th, 2008, 10:33 AM
Registered User
 
Join Date: Nov 2008
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your input. I will try to write new XSL

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT convertion help mwells XSLT 3 February 2nd, 2007 10:00 AM
XSLT help : Interpretting HTML tags from XML kunal_kishan XSLT 1 June 26th, 2006 05:37 AM
Two HTML Tables and Two XSLT with Two XML? gman44 XSLT 1 March 1st, 2006 04:53 AM
constructing a HTML table from xml data using xslt rameshnarayan XSLT 0 September 19th, 2005 06:53 AM
Add XSLT transformed XML (html) on an aspx page humour XSLT 2 September 30th, 2004 05:13 AM



All times are GMT -4. The time now is 10:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.