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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
- Stylus Studio Technical Forum (14621)
-> - Stylus Studio - Registrar en o... (1)
-> + Stylus Studio - Registrar en o... (2)
-> + Can a pipeline send a file by ... (2)
-> + After Updateing WIN10 to WIN11... (12)
-> + Where do I add the custom java... (3)
-> + Where is the Diagram tab? (5)
-> + Applying XSLT to Word DOCX/XML (2)
-> - CSV conversion via ConvertToXM... (1)
-> + Text symbols in SS not same as... (4)
-> + Exposing xquery as webservice ... (6)
-> + Syntax Identifier (2)
-> + Saving a Converted XML as an X... (5)
-> + Output document cannot be pars... (4)
-> - Archiving output from conversi... (1)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (249)
+ XSLT Help and Discussion (7625)
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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

   
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.