• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

how to transform mixed xml+html file?

 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

 
Space pants. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic