1 Oct 2008 12:15
Reading out an attribute
lo all
i'd like to find the id attribute in the /application/module/ path. the
command i'm using to get that attribute is:
<copy path="/application/module/ <at> id" attrvalue="true" property="id_value"/>
but when i echo the property it just gives me the property name $
{id_value} , which means that it has not been read out of my xml structure.
in several cases i have to put a : in front of my path, for reading out
the /application/display-name/text() i have to use
<copy path="/:application/:display-name/text()" property="dn_value"/>
to make it work. but i have read a lot of xpath tutorials but i did not
found a lesson where i have to put colon in front of every node.
so how do i read out this id as mentioned above ? it worked for me 2 weeks
ago but after trying it again today i only get an empty property.
Thats my xml file:
<?xml version="1.0" encoding="UTF-8"?>
<application id="Application_ID" version="1.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/application_1_4.xsd">
<display-name>EARFILE</display-name>
(Continue reading)
RSS Feed