Asp Xml

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kalyformin
    New Member
    • Mar 2008
    • 2

    #1

    Asp Xml

    I have been trying to verify that a node with a ceratin value exists in XML. Here is my XML -
    [code=xml]
    <root>
    <parameters>
    <filter object="Header" >
    <Details >
    <Detail object="Detail" >
    <criteriaCode>i ncludeInSearch</criteriaCode>
    </Detail>
    <Detail object="Detail" >
    <criteriaCode>s tatus</criteriaCode>
    </Detail>
    <Detail object="Detail" >
    <criteriaCode>e ffectiveDate</criteriaCode>
    </Detail>
    </Details>
    </filter>
    </parameters>
    </root> [/code]

    What I have been trying to check is that node value 'effectiveDate' exists within the <criteriaCode > node. Can we do this with ASP?

    Any help is appreciated.
    Last edited by jhardman; Mar 18 '08, 09:03 PM. Reason: put code in code tags. Please note button marked - #
  • garethharvey
    New Member
    • Apr 2008
    • 14

    #2
    Are you using an xsl style sheet to parse the data?

    If so, you could use a function in the head of the style sheet as follows:

    Code:
    <![CDATA[ 
        Function checknode(var)
    	IF var> THEN checknode=var **- perform what ever function you need here.
        End Function
      ]]>
    The in the body of the XSL sheet:

    Code:
    <xsl:value-of select="user:checknode(string(effectiveDate))" />

    Comment

    Working...