This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 185197 - [69cat] XML: XSLT Template Designed for HTML; process doesn't consider XML or TEXT output methods
Summary: [69cat] XML: XSLT Template Designed for HTML; process doesn't consider XML or...
Status: NEW
Alias: None
Product: xml
Classification: Unclassified
Component: Code (show other bugs)
Version: 7.0.1
Hardware: PC Windows XP
: P4 normal (vote)
Assignee: issues@xml
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-28 16:16 UTC by gliesian
Modified: 2012-05-28 12:11 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gliesian 2010-04-28 16:16:48 UTC
The XSLT standard includes "xml", "html", "text", and Qualified Names output methods for its configuration.  However, the template provided by NetBeans (Ctrl-N, XML, XSL Stylesheet) creates a template for the 'html' output method only: 

  <?xml version="1.0" encoding="UTF-8"?>
  <!--
      Document   : newstylesheet1.xsl
      Created on : April 28, 2010, 12:03 PM
      Author     : ...
      Description:
          Purpose of transformation follows.
  -->
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"   version="1.0">
      <xsl:output method="html"/>

      <!-- TODO customize transformation rules 
           syntax recommendation http://www.w3.org/TR/xslt 
      -->
      <xsl:template match="/">
          <html>
              <head>
                  <title>newstylesheet1.xsl</title>
              </head>
              <body>
              </body>
          </html>
      </xsl:template>
  </xsl:stylesheet>  

I recommend adding a step to the wizard to create three separate templates (xml, html and text)... either that or create a more generic template as was done by Eclipse:

  <?xml version="1.0" encoding="UTF-8"?>
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:template match="/">
		<!-- TODO: Auto-generated template -->
     </xsl:template>
  </xsl:stylesheet>

Just FYI, Altova XMLSpy sets 'xml' as their default output:

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

From (http://www.w3.org/1999/XSL/Transform):
XSL Transformations (XSLT)
Version 1.0
W3C Recommendation 16 November 1999

16.1 XML Output Method
The xml output method outputs the result tree as a well-formed XML external general parsed entity. If the root node of the result tree has a single element node child and no text node children, then the entity should also be a well-formed XML document entity.

16.2 HTML Output Method
The html output method outputs the result tree as HTML

16.3 Text Output Method
The text output method outputs the result tree by outputting the string-value of every text node in the result tree in document order without any escaping.