your XSL source must be XML valid : you should write <element/> (with auto-closing tag) instead <element> .

On Mon, 5 Jul 2004 15:05:11 +0200, Peter Lerche <[EMAIL PROTECTED]> wrote:

Hi,

I am going bonkers. I have spend the all weekend on this.

My problem only occurs when supplying ctx.getModel() as an org.w3c.dom.Node to
the TrivialViewFactory.


If I have an empty element with an attribute the xslt parser ignore the rest
of xml source.
eg:
Source:
--------
<root>
<element text="the parser stops here"/>
<help>
anything after the <element> is lost during xslt transformation
</help>
</root>



Output: -------- <root> <element text="the parser stops here"/>blem only occures when supplieng ctx.getModel() as an org.w3c.dom.Node </root>





I am using an XML db (exist-db.org) controller which provide an
org.w3c.dom.Node to the TrivialViewFactory.
The TrivialViewFactory does a
81: Source src = new javax.xml.transform.dom.DOMSource((Node)vctx.getModel());
and forward the src to
343: XSLTransform.java trans.transform(input, res); as the input param.


The vctx.getModel holds the XML DB result-set as a dom.Node. I have checked
the content of vctx.getModel.toString() and it looks perfect.



Here is another example.


an example:


maverick.xml: ----------------

<command name="*">
        <!-- This is a controller for the eXist XML db http://exist-db.org -->
        <controller class="com.easyspeedy.maverick.ctl.ExistControler">
                   <param name="xquery" value="xdfs/xquery/test.xq"/>
                   <param name="ext" value="xml"/>
        </controller>
        <view type="trivial" name="success">
                <transform type="xslt"  path="/xdfs/stylesheets/empty.xsl"/>
         </view>
</command>

Stylesheet:
------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:xd="http://xmldream.com/NS/core/1.0";>

<!-- This stylesheet does nothing but copy input source to output -->
<xsl:template match="@*|*|text()|processing-instruction()" priority="-1">
<xsl:copy>
<xsl:apply-templates
select="@*|*|text()|processing-instruction()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>




XML source WORKING:
---------------
<xd:document xmlns:xd="http://xmldream.com/NS/core/1.0";>
      <p>This is a text 1</p>
    <xd:content>
         <p>This is a text 2</p>
        <xd:block>
             <p>This is a text 3</p>
 <!-- xd:usages This element is fine-->
            <xd:usages/>  <!--This is fine-->
            <p>This is a text 4</p>
            <xd:body>
                 <p>This is a text 5</p>
            </xd:body>
            <p>This is a text 6</p>
        </xd:block>
             <p>This is a text 7</p>
    </xd:content>
</xd:document>

XML WORKING OUTPUT:
This is a text 1
This is a text 2
This is a text 3
This is a text 4
This is a text 5
This is a text 6
This is a text 7



XML Source NOT WORKING:
---------------
<xd:document xmlns:xd="http://xmldream.com/NS/core/1.0";>
<p>This is a text 1</p>
<xd:content>
<p>This is a text 2</p>
<xd:block>
<p>This is a text 3</p>
<!-- xd:usages - if the element has an attribute and no child elements it will
stop XSLT processing-->
<xd:usages title="Data Center"/> <!-- Stops here -->
<p>This is a text 4</p>
<xd:body>
<p>This is a text 5</p>
</xd:body>
<p>This is a text 6</p>
</xd:block>
<p>This is a text 7</p>
</xd:content>
</xd:document>


XML NOT WORKING OUTPUT:
This is a text 1
This is a text 2
This is a text 3







-- ----------------------------------- Pierre de Soyres Ingénieur d'études

e-Manation
14 Bd du Maréchal Juin
44100 Nantes
FRANCE

Tel: +33 (0)2 40 43 06 11
Fax: +33 (0)2 40 43 30 02
www.e-manation.com
-----------------------------------


*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- Les informations contenues dans ce courrier electronique et dans les fichiers qui y sont attachees sont confidentielles et peuvent etre protegees legalement. Elles ne sont adressees qu'au destinataire. L'acces a ce courrier electronique par toute autre personne n'est pas autorise. Si vous n'etes pas le destinataire voulu, toute divulgation, copie ou diffusion de ce courrier electronique est interdite et peut etre illegale. Sauf mention contraire dans le corps du message, la presence de cette note prouve egalement que ce message electronique a ete verifie par un logiciel anti-virus. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- This email and any attached file are confidential and intended solely for the use of the individual or entity to whom they are addressed. Accessing this email by anyone else than the recipient is forbidden and may be illegal. If you received this email by error please notify the system administrator. This footnote also confirms that this message has been scanned by an anti-virus software. *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-




-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - digital self defense, top technical experts, no vendor pitches, unmatched networking opportunities. Visit www.blackhat.com
[INVALID FOOTER]

Reply via email to