Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to transform mixed xml+html file?

 
Holmes Wong
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to transform a mixed xml+html file into xhtml, I can
create a xsl stylesheet to translate xml part, but I do
not know how to keep html code and its location.
The following is a sample file:
<?xml version="1.0" encoding="utf-8"?>
<sim xmlns='http://www.w3.org/TR/REC-html40'
xmlns:sample='http://www.sample.com/sam'>
<sample:form>
<b>Sample file</b>
<form:tag1/>
<form:tag2 values=�value1� defined=�value2�/>
<input type=�text� name=�student�/>
<input type=�submit/>
</sample:form>
</sim>
Thanks in advance for your input.
 
Lasse Koskela
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XSL can only be applied to well-formed XML documents. If you've got a mix of HTML and XML that is not well-formed, I'm afraid there's nothing you can do but fix it somehow before proceeding with the XSL transformation. If the HTML stuff is well-formed, there is no problem -- the parser considers it as XML just like the standard XHTML tags, right? Or did I miss something?
 
Holmes Wong
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Lasse:
You reminded me of using xhtml as standard xml to be processed
by xsl file. I guess I need to make xml file well-formed first.
Originally posted by Lasse Koskela:
XSL can only be applied to well-formed XML documents. If you've got a mix of HTML and XML that is not well-formed, I'm afraid there's nothing you can do but fix it somehow before proceeding with the XSL transformation. If the HTML stuff is well-formed, there is no problem -- the parser considers it as XML just like the standard XHTML tags, right? Or did I miss something?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic