← Prev in month ← Prev in thread
Next in thread → Next in month →

[xacml] XPath with namespace

From
Michiharu Kudoh <>
Date
2002-07-16T15:18:51+00:00
ID
OF64A99E98.180BC089-ON49256BF8.00520ACB@LocalDomain
Thread
[xacml] XPath with namespace
XPath expression becomes complicated when it uses namespaces. For example,
a simple XPath /Request/Subjects/SubjectId becomes
/*[namespace-uri()="urn:oasis:names:tc:xacml:0.15h:context" and local-name
()="Request"]/*[namespace-uri()="urn:oasis:names:tc:xacml:0.15h:context"
and local-name()="Subjects"]/*[namespace-uri()
="urn:oasis:names:tc:xacml:0.15h:context" and local-name()="SubjectId"]

The above expression shows the correct use of an XPath that can generally
handle namespaces without fixing namespace prefixes. There are a couple of
ways to make expressions simpler with some assumptions based on specific
XPath implementation. In case of Apache Xalan, a simple XPath
/xctx:Request/xctx:Resource/xctx:ResouceContent/md:patient/md:patientName
can be processed if the context node set (handed to the XPath API) contains
namespace definitions at the top node (Request element) such as xmlns:xctx
="urn:oasis:names:tc:xacml:0.15h:context" xmlns:md
="medico.com/records.xsd".

Michiharu

IBM Tokyo Research Laboratory, Internet Technology
Tel. +81 (46) 215-4642   Fax +81 (46) 273-7428
← Prev in month ← Prev in thread
Next in thread → Next in month →