OASIS eXtensible Access Control Markup Language (XACML) TC

 View Only

[xacml] XPath with namespace

  • 1.  [xacml] XPath with namespace

    Posted 07-16-2002 11:19
     MHonArc v2.5.2 -->
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    xacml message

    [Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


    Subject: [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
    
    
    
    
    


    [Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


    Powered by eList eXpress LLC