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

XML from JSP

Subject: XML from JSP
From: Gavin Myers <gavinm@xxxxxxxxx>
Date: Fri, 15 Nov 2002 14:29:54 -0600
jsp xml
I have to include an xml file, like this:
[XML name=text.xml]
<?xml version="1.0"?>
<text>
	<block ID="1">this</block>
	<block ID="1">is</block>
	<block ID="1">a</block>
	<block ID="4">test</block>
	<block ID="5">work!</block>
</text>
[/XML]

[XSL]
<xsl:key name="block" match="/text/block" use="@ID"/>
<xsl:for-each select="document('text.xml')">
  <xsl:for-each select="key('block', '1')">
    <xsl:value-of select="."/>
  </xsl:for-each>
</xsl:for-each>
[/XSL]

This works fine. I can rename it from text.xml to text.jsp and it will still
work. But, once I try to add jsp commands in it will break. Something as
simple as this:

[JSP name=text.jsp]
<?xml version="1.0"?>
<%
String block = "work";
%>
<text>
	<block ID="1">this</block>
	<block ID="1">is</block>
	<block ID="1"><%=block%></block>
	<block ID="4">test</block>
	<block ID="5">work!</block>
</text>
[/JSP]

The JSP will compile fine and output just like the XML did, but I get the
following error: Can not load requested doc: The markup in the document
preceding the root element must be well-formed.

I'm assuming it is taking the JSP and not compiling it (treating it as is).
Is this true? Is there anything I can do to work around this?

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


Current Thread
  • XML from JSP
    • Gavin Myers - Fri, 15 Nov 2002 15:26:03 -0500 (EST) <=
      • <Possible follow-ups>
      • sara . mitchell - Fri, 15 Nov 2002 16:23:02 -0500 (EST)
        • Mike Brown - Fri, 15 Nov 2002 19:11:00 -0500 (EST)
        • Mike Brown - Fri, 15 Nov 2002 19:21:52 -0500 (EST)

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.