RE: html - xml transformation - imbricating html <p> tags in header tags

My html documents are valid xml, I need the syntax to nest paragraphs in sections/subsections  and subsections in parent sections.
Thank you for your help,
Pascale

Bernhard Keil <Bernhard.Keil@soft4science.com> wrote:
Hello,
you can use XSLT to transform from XML to XML (or non-xml).
So the the input source has to be valid XML.

I general you cant transform html by XSLT, as html is not in general valid xml.
But your source example is a valid XML document. So if all of your source documents
are valid XML like this html source example, than you can use 
XSLT to transorm it to some other XML format.

If your html source documents are not valid XML documents,
you can use a tool like Tidy to make it valid XML.


regards,
Bernhard Keil
http://www.soft4science.com



-----Original Message-----
From: www-math-request@w3.org [mailto:www-math-request@w3.org] On Behalf Of zn p
Sent: Wednesday, October 20, 2004 2:17 PM
To: www-math@w3.org
Cc: DSSSList@lists.mulberrytech.com
Subject: [Norton AntiSpam] html - xml transformation - imbricating html 
tags in header tags


Hello,

I am trying to convert html files to xml files. I need to nest (copy) subsections in parent sections, and paragraphs in the
corresponding sections .

Is it possible to do it with xsl?

Here is an example (knowing that the files are more complex than this):

h1 is the document title, h2 section title, h3 subsection title. 
should go under the corresponding section, and section (h3)
should go under the parent section (h2) in the output xml.



Document Title

Content of paragraph 1

Header 2

First paragraph of section 1


Second paragraph of section 1

Header 3

Test de p dans 2eme para 3

Header 2

First paragraph of section 2




To be converted into:



Content of paragraph 1




First paragraph of subsection 1





First paragraph of section 2




Thanks,
PZN



---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez
GRATUITEMENT ici !
--0-1846014824-1098274601=:81511
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Hello,
 
I am trying to convert html files to xml files.  I need to nest (copy) subsections in parent sections,
and paragraphs in the corresponding sections .
 
Is it possible to do it with xsl?
 
Here is an example
(knowing that the files are more complex than this):
 
h1 is the document title, h2 section title, h3 subsection title.
<p> should go under the corresponding section, and section (h3) should go under the parent section (h2) in the output
xml.
 
<html>
<body>
<h1>Document Title</h1>
<p>Content of paragraph
1</p>
<h2>Header 2</h2>
<p>First paragraph of section 1</p>
<p>Second paragraph of
section 1</p>
<h3>Header 3</h3>
<p>Test de p dans 2eme para 3</p>
<h2>Header
2</h2>
<p>First paragraph of section 2</p>
</body>
</html>
 
To
be converted into:
<document>
<title>Document Title</title>
<paragraph>Content of paragraph
1</paragraph>
    <section>
        <title>Header
2>/title>
          <paragraph>First paragraph of section
1</paragraph>
           <paragraph>Second paragraph of section
1</paragraph>
               
<section>
                   
; <title>Header
3</title>
                   
; <paragraph>First paragraph of subsection
1</paragraph>
               
</section>
         </section>
       
<section>
          <paragraph> First paragraph of section
2</paragraph>
      </section>
</document>
 
Thanks,
PZN




---------------------------------

Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !

href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/evt=25917/*http://fr.rd.yahoo.com/mail/mail_taglines_100/default/
*http://fr.benefits.yahoo.com/">Créez votre Yahoo! Mail


Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer
instantanément avec vos amis.
href="http://fr.rd.yahoo.com/mail/taglines/*http://fr.rd.yahoo.com/evt=26111/*http://fr.rd.yahoo.com/messenger/mail_taglines/default
/*http://fr.messenger.yahoo.com">Téléchargez GRATUITEMENT ici !
--0-1846014824-1098274601=:81511--





		
---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !

Received on Wednesday, 20 October 2004 12:44:44 UTC