The ptoblem is x:set  / doesn't work .

xml file
<?xml version="1.0" encoding="UTF-8"?>
<person id='js890'>
</person>jsp code
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>
<html>
     <body>
          <c:import var="xml" url="sample.xml"/>
          <x:parse varDom="dom" xml="${xml}"/>
          <x:set var="attrPersonId" select="string($dom/person/@id)"/>
          cout=<c:out value="${attrPersonId}" /><br>
          xout=<x:out select="$dom/person/@id"/>
     </body>
</html>the output
cout=
xout=js890
So, why <x:set /> doesn't set the variable attrPersonId to js890?

The error is in XPath query
I should not have typed the root node.
The correct expression is
<x:set var="attrPersonId" select="string($dom/@id)"/>

Similar Messages

Maybe you are looking for

  • Firewire External Enclosure very hot.

    I am wondering if anyone else has a Serial ATA Seagate 200gb 7200rpm hard drive in a Firewire 800 external enclosure. Mine runs very hot in comparison to my IDE hard drives in the same OWC brand Firewire 800 enclosures. If this is abnormal I would li

  • Lollipop update for note 3

    Hi i bot an AT&T Samsung Galaxy Note 3 from the U. S. A. I unlocked is here in Bangladesh locally. Bt i cant use NFC neither i can use my phone as Hotspot. Also i m unable to receive updates for lollipop. Any suggestions for me how to solve my proble

  • Extending JSP with new Tags

    Hi, I'm trying to learn JSP custom Tags. I'm using JDK 1.6 Eclipse 1.2.1 Tomcat 6.0 I have added the External JAR "servlet-api.jar" from Tomcat6.0/lib. I'm trying to create the following HelloWorldTag.java in a "Dynamic Web Project" in Eclipse in a p

  • Another glitch in script using Style Groups

    Hello, Everythig was going fine till it started to get complex. I was hoping to adapt a script for cleaning up multiple character styles so that it would work with character styles in a style group, but I get an undefined variable error. Not quite su

  • [SOLVED] boot partition does not output on genfstab.

    I have installed Arch Linux 5 or 6 times and even had desktop environments. This is a first for this to happen. I do not have a way to copy and paste so I cannot reproduce all code. I have 4 partitions. They are:  /, home, boot, and swap. This is new