Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001858 [Resin] minor always 07-09-07 15:44 08-21-07 15:06
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.1.3 Product Version 3.1.1
  Product Build
Summary 0001858: jstl/xml issue with non-Resin xml parser
Description (rep by Bill Au)

<%@ page contentType="text/html;charset=UTF-8" language="java"
         import="javax.xml.parsers.*,
                 org.w3c.dom.Document,
                 org.xml.sax.InputSource,
                 java.net.URLEncoder,
                 java.net.URL,
                 java.util.*,
                 java.io.*,
                 java.text.*
"
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" [^] %>
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" [^] %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" [^] %>



<c:set var="userId" value="333" scope="page"/>
<!-- ############################################################## -->


<x:parse var="working" >
  <users>
   <user id="333">
     <name>bob</name>
   </user>
   <user id="444">
     <name>tom</name>
   </user>
  </users>
</x:parse>

All 3 of these should be 'bob' ...

    <!-- literal value -->
  1. '<x:out select="$working//user[@id=333]/name" />'

  2. <!-- page is default scope -->
  3. '<x:out select="$working//user[@id=$userId]/name" />'

  4. <!-- fully specified scope -->
  5. '<x:out select="$working//user[@id=$pageScope:userId]/name" />'



<!-- ############################################################## -->
<hr />
<!-- ############################################################## -->

<%
    String rawxml = "<users><user id=\"333\"><name>bob</name></user><user id=\"444\"><name>tom</name></user></users>";

    DocumentBuilderFactory DOM_FACTORY
        = DocumentBuilderFactory.newInstance();
    DocumentBuilder b = DOM_FACTORY.newDocumentBuilder();

    Document domdoc = b.parse(new InputSource(new StringReader(rawxml)));
    if (null == domdoc) {
        throw new Exception("domdoc is null");
    }
    request.setAttribute("broken",domdoc);
%>

All 3 of these should be 'bob' ...

    <!-- literal value -->
  1. '<x:out select="$broken//user[@id=333]/name" />'

  2. <!-- page is default scope -->
  3. '<x:out select="$broken//user[@id=$userId]/name" />'

  4. <!-- fully specified scope -->
  5. '<x:out select="$broken//user[@id=$pageScope:userId]/name" />'


Steps To Reproduce
Additional Information
Attached Files

- Relationships

- Notes
(0002211)
ferg
08-21-07 15:06

jsp/1g5a, see also 0001943
 

- Issue History
Date Modified Username Field Change
07-09-07 15:44 ferg New Issue
08-21-07 15:06 ferg Note Added: 0002211
08-21-07 15:06 ferg Assigned To  => ferg
08-21-07 15:06 ferg Status new => closed
08-21-07 15:06 ferg Resolution open => fixed
08-21-07 15:06 ferg Fixed in Version  => 3.1.3


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed.
26 unique queries executed.
Powered by Mantis Bugtracker