[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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
xslt copy elements
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)

Regards!

Vit

======================= 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
 *-->
<MyRootElement
  date="2000-07-04"
  author="Vitaly Rudovich"
  DTDID="XHTML"
  >
  <MyParametersList>
  <MyParameter name=":test_sql"
               value="select * from some_table"
               type="string"
               description="The SQL select command"
                />
  </MyParametersList>
  <html>
  <head>
    <title> TEST XHTML </title>
  </head>
  <body>

  <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="http://www.w3.org/1999/xhtml">
  <head>
    <title> TEST XHTML </title>
  </head>
  <body>

  <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
                       "MyElements.dtd">
%myelements.decl;

<!-- Include XHTML declaration -->
<!ENTITY % xhtml.decl SYSTEM
                       "xhtml1Dtd/xhtml1-strict.dtd">
%xhtml.decl;

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




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.