xpath 1.0 : subset matches an attribute list? -


In XML, I have elements with attributes that contain a list of categories, for example: cat = "ABCD"

Is there any possibility with the xpath 1.0 (I am using XSLT in Firefox) to return all the elements, where the list of categories matches the list? For example:

subset (AC) cat (ABC) true

subset (D) cat (AC) false

Subset (AC) Cat (AB) False

Thank you Your Help

Here are some code that basically what you want. The XSLT wrapper is just set to the variable.

  & lt; Xsl: variable name = "subset" = "AC" /> & Lt; Select xsl: variable name = "matches" = "// * [translate ($ subset, contact (@cat, ''), '') = '']] />   

Of course, depending on the type of elements you are trying to match, you may need to zoom to // * .

Concatenating < A place for Code> @cat is required only if you do not have a subset string like 'D' in which there is no free space.

This The code also assumes that all category names are single-axis Are. If it is not, then let me know.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -