ASF Bugzilla – Attachment 12691 Details for
Bug 31147
using Node variables with JSTL XML tags
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for XPathUtil.java
Bug31147.patch (text/plain), 2.12 KB, created by
Kris Schneider
on 2004-09-10 02:49:48 UTC
(
hide
)
Description:
Patch for XPathUtil.java
Filename:
MIME Type:
Creator:
Kris Schneider
Created:
2004-09-10 02:49:48 UTC
Size:
2.12 KB
patch
obsolete
>Index: XPathUtil.java >=================================================================== >RCS file: /home/cvspublic/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/xml/XPathUtil.java,v >retrieving revision 1.18 >diff -u -r1.18 XPathUtil.java >--- XPathUtil.java 16 Aug 2004 21:38:29 -0000 1.18 >+++ XPathUtil.java 10 Sep 2004 02:39:52 -0000 >@@ -433,6 +433,13 @@ > } > return null; > } >+ >+ static Document getDocumentForNode(Node node) { >+ Document doc = getDummyDocumentWithoutRoot(); >+ Node importedNode = doc.importNode(node, true); >+ doc.appendChild(importedNode); >+ return doc; >+ } > > // The following variable is used for holding the modified xpath string > // when adapting parameter for Xalan XPath engine, where we need to have >@@ -675,10 +682,7 @@ > if ( Class.forName("org.w3c.dom.Node").isInstance( > jstlNodeList.elementAt(0) ) ) { > Node node = (Node)jstlNodeList.elementAt(0); >- Document doc = getDummyDocumentWithoutRoot(); >- Node importedNode = doc.importNode( node, true); >- doc.appendChild (importedNode ); >- boundDocument = doc; >+ boundDocument = getDocumentForNode(node); > if ( whetherOrigXPath ) { > xpath="/*" + xpath; > } >@@ -723,7 +727,10 @@ > } > } else if ( Class.forName("org.w3c.dom.Node").isInstance( > varObject ) ) { >- boundDocument = (Node)varObject; >+ boundDocument = getDocumentForNode((Node)varObject); >+ if (whetherOrigXPath) { >+ xpath = "/*" + xpath; >+ } > } else { > boundDocument = getDummyDocument(); > xpath = origXPath;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 31147
: 12691