XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Yves GenestSubject: HTML to XML Wizard using badly-formed HTML as source
Author: Yves Genest
Date: 21 Feb 2006 10:22 AM
Hello,

I,m new to xml and Stylus. I have a set of HTML files that has badly formed HTML sections in it. The offending section is as follow:

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width='486' >
<FORM>
<TR>
<script language="javascript">
<!---
var name = navigator.appName;
var Version = navigator.appVersion.substring(0,navigator.appVersion.indexOf("."));

if ((Version >= 4) && (name == "Netscape"))
{
document.writeln("<TD valign='top' class='tabOn' id='id1'>Hotels</TD>");
}
else
{
document.writeln("<TD valign='top' class='tabOn' id='id1'><INPUT TYPE=RADIO NAME=res_type VALUE='1' onclick_='changeForm(this.value);' checked>Hotels</TD>");
}
//-->
</script>

</TR></FORM>
</TABLE>

As you can see, this code snippet generate a different TD tag depending on the browser type. The wizard generates the following xml:

<form>
<script language="javascript" type="text/javascript">
&lt;!---
var name = navigator.appName;
var Version =
navigator.appVersion.substring(0,navigator.appVersion.indexOf(&quot;.&quot;));

if ((Version &gt;= 4) &amp;&amp; (name ==
&quot;Netscape&quot;))
{
document.writeln(&quot;&lt;TD
valign=&#39;top&#39; class=&#39;tabOn&#39;
id=&#39;id1&#39;&gt;Hotels&lt;\/TD&gt;&quot;);
}
else
{
document.writeln(&quot;&lt;TD
valign=&#39;top&#39; class=&#39;tabOn&#39;
id=&#39;id1&#39;&gt;&lt;INPUT TYPE=RADIO NAME=res_type
VALUE=&#39;1&#39; onclick_=&#39;changeForm(this.value);&#39;
checked&gt;Hotels&lt;\/TD&gt;&quot;);
}
//--&gt;

</script>
<table>
<tr>
<td></td>
</tr>
</table>
</form>
<table border="0" cellpadding="0" cellspacing="0" width='486'>
</table>


as you can see the code as been reformatted and does not produce the result of the original html.

is there a way to get around this ? i don't care if for now the badly formed html get transfered as-is in the xml file.

Thanks

Postnext
(Deleted User) Subject: HTML to XML Wizard using badly-formed HTML as source
Author: (Deleted User)
Date: 21 Feb 2006 11:10 AM
Hi, Yves. You can use HTML Tidy, which is bundled as an adpater in Stylus Studio. You can learn more about this in the following SSDN thread:

http://www.stylusstudio.com/SSDN/default.asp?action=9&fid=48&read=3780

Hope this helps.

David Foster
Stylus Studio Team

Postnext
Yves GenestSubject: HTML to XML Wizard using badly-formed HTML as source
Author: Yves Genest
Date: 21 Feb 2006 11:58 AM
Hi David,

Thanks for your reply. I tried your solution and it works. The only problem is that I own the home version of Stylus (but still have access to the eval enterprise for ... 29 days!).

Can I add HTML Tidy as a custom tool in my home edition under the option menu ?

Does the pro version have this option?

How can I upgrade from home to pro?

Thanks


Posttop
(Deleted User) Subject: HTML to XML Wizard using badly-formed HTML as source
Author: (Deleted User)
Date: 21 Feb 2006 12:58 PM
Hi, Yves. I'm glad the HTML Tidy adapter worked for you. XML converters (including HTML Tidy) are available only in the Enterprise version of Stylus Studio.

To upgrade Stylus Studio, contact our sales department at stylusstudio at stylusstudio dot com and explain your current situation.

David Foster
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.