Hi,

I am trying to use the REST driver to extract information from the
following url. http://api.kle-online.dk/resources/hovedgrupper
I am getting the entire XML document, that is nice.

Now I want to get each of the underlying entities hg:Hovedgruppe things
into a nodeset (and later on, get the values pr. entry).
I've tried a lot of things for example this.

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE policy PUBLIC "policy-
builder-dtd" "/home/nje/designer45/plugins/
com.novell.idm.policybuilder_4.0.0.201606062141/DTD/
dirxmlscript4.5.dtd"><policy xmlns:es="http://www.novell.com/nxsl/
ecmascript" xmlns:rs="http://www.novell.com/nxsl/java/
com.novell.nds.dirxml.driver.rest.common.JSONConve rter">
<rule>
<description>Parsing</description>
<conditions>
<and>
<if-xml-attr mode="nocase" name="command"
op="equal">poll</if-xml-attr>
</and>
</conditions>
<actions>
<do-if>
<arg-conditions>
<and>
<if-xml-attr
name="command" op="available"/>
</and>
</arg-conditions>
<arg-actions>
<do-if>
<arg-conditions>
<and>
<if-xml-
attr mode="nocase" name="command" op="equal">poll</if-xml-attr>
</and>
</arg-conditions>
<arg-actions>
<do-if>
<arg-
conditions>

<and>

<if-xpath op="true">string-length(./response/value/text())>0</if-xpath>
</
and>
</arg-
conditions>
<arg-
actions>

<do-set-local-variable name="xmlInput" scope="policy">

<arg-string>

<token-xpath expression="./hg:Hovedgruppe/HovedgruppeNr"/>

</arg-string>
</
do-set-local-variable>

<do-set-local-variable name="xmlInputParse" scope="policy">

<arg-node-set>

<token-xml-parse>

<token-local-variable name="xmlInput"/>

</token-xml-parse>

</arg-node-set>
</
do-set-local-variable>

<do-strip-xpath expression="."/>

<do-for-each>

<arg-node-set>

<token-local-variable name="xmlInputParse"/>

</arg-node-set>

<arg-actions>

<do-trace-message>

<arg-string>

<token-text xml:space="preserve">CONTENT NODE:</token-text>

<token-local-variable name="current-node"/>

<token-text xml:space="preserve">CONTENT VALUE:</token-text>

<token-local-variable name="current-value"/>

</arg-string>

</do-trace-message>

</arg-actions>
</
do-for-each>
</arg-
actions>
<arg-
actions/>
</do-if>
</arg-actions>
<arg-actions/>
</do-if>
<do-trace-message>
<arg-string>
<token-text
xml:space="preserve">XMLINPUT-RAW</token-text>
<token-local-
variable name="xmlInput"/>
</arg-string>
</do-trace-message>
<do-trace-message>
<arg-string>
<token-text
xml:space="preserve">XMLINPUT-Parsed</token-text>
<token-local-
variable name="xmlInputParse"/>
</arg-string>
</do-trace-message>
<do-veto/>
</arg-actions>
<arg-actions/>
</do-if>
</actions>
</rule>
</policy>

The result is:


DirXML Log Event -------------------
Driver: \BLACKPILL\system\driverset1\Rest Driver
Channel: Subscriber
Status: Error
Message: Code(-9130) Error in vnd.nds.stream://BLACKPILL/system/
driverset1/Rest+Driver/itp-HTMLtoXDS#XmlData:464 : An invalid XPATH
expression './hg:Hovedgruppe/HovedgruppeNr' is specified:
java.lang.IllegalArgumentException: DOMEvaluator parser error: namespace pr
efix 'hg' could not be resolved.

What can be wrong here? Whatever I do, it keeps complaining about the hg
namespace.

-Nicolai