Jump to content

XSL generates empty document

Recommended Posts

My xslt code generates empty document

Source document:

<root xmlns="http://www.w3schools.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" sender="CODE1">


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method="xml" encoding="windows-1251" indent="yes" />

   <xsl:template match="/">
      <xsl:element name="root">
         <xsl:element name="sender">
            <xsl:value-of select="/root/@sender" />

         <xsl:element name="number">
            <xsl:value-of select="/root/document/documentNumber" />

         <xsl:element name="date">
            <xsl:value-of select="/root/general/date" />

But when from source document root tag remove all xmls parameters - everything works fine.


How can I solve this problem?

Edited by Algimka
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...