RE: Q XSLT: How to copy elements with XT?

Subject: RE: Q XSLT: How to copy elements with XT?
From: v.rudowitsch@xxxxxx
Date: Wed, 27 Sep 2000 16:22:11 +0100
Now I have got just one other problem. :-)

Mike Kay wrote:

> > The problem is that I do not know how apply templates to my elements
> > only and copy XHTML tags into result file without changes.
> Write a default template that copies elements:


> And then specific template rules for your own elements that do something
> different.

I had changed my template but XSLT has a strange behavior. If I use DOCTYPE
declaration, only the copy template is applied. More precise all elements that
are children of XHTML tags are copied into output. The XSLT work as I exepcted
only in case I comment out DTD declaration in my XML file. Other XML files that
don't have XHTML tags are processed without problems.

What is wrong?

My XML file and DTD declarations are below. (I had changed some names)



======================= XML START ========================

<?xml version="1.0" ?>
<!DOCTYPE MyRootElement SYSTEM "XHTML_With_My_Elements.dtd">
<!-- HINT: if DOCTYPE is present, XT copies elements.
 +         To perform XSL transformation remove DOCTYPE
  author="Vitaly Rudovich"
  <MyParameter name=":test_sql"
               value="select * from some_table"
               description="The SQL select command"
    <title> TEST XHTML </title>

  <h1> Common test</h1>
     <p> <MyText >Execution time = </MyText><MyTime>...</MyTime> </p>

======================= XML END   ========================

If DOCTUPE is present the result is:

================= XSLT Result Start  ========================

  <html  xmlns="";>
    <title> TEST XHTML </title>

  <h1> Common test</h1>
     <p> <MyText >Execution time </MyText> <MyTime>...</MyTime> </p>

================= XSLT Result  END   ========================

======================= DTD START  ========================

<!-- Redefine My Root element content  -->
<!ENTITY % my_root_element_content "((MyParametersList)? ,html)">

<!-- Redefine XHTML misc content -->
<!ENTITY % misc "    MyParameter
                   | MyText
                   | MyTable
                   | MyTime
                   | MySQLQuery
<!-- Include declaration of my elements  -->
<!ENTITY % myelements.decl SYSTEM

<!-- Include XHTML declaration -->
<!ENTITY % xhtml.decl SYSTEM

<!-- *********** My additional elements  ******* -->
=======================  DTD END   ========================

 XSL-List info and archive:

Current Thread