xsl-list
[Top] [All Lists]

RE: How Do I Select A Section of XML Based On A Code Value

2004-02-25 08:25:02
I'd try

select="VehInfo[descendant::UsageInfoCode='Work']"



-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
Gary Fix
Sent: Wednesday, February 25, 2004 10:17 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] How Do I Select A Section of XML Based On A Code Value


Hi,
I have an xml something like this:

      <VehInfo>
              <ModelYear>2004</ModelYear>
              <Model>Ford</Model>
              <UsageInfo>
                      <UsageInfoCode>Work</UsageInfoCode>
              </UsageInfo>
      </VehInfo>
      <VehInfo>
              <ModelYear>1994</ModelYear>
              <Model>Toyota</Model>
              <UsageInfo>
                      <UsageInfoCode>Pleasure</UsageInfoCode>
              </UsageInfo>
      </VehInfo>

and want to transform this into xml using xsl, selecting the 
correct section based on the <UsageInfoCode> tag. For example, if 
I am to select using an "UsageInfoCode" of "Work", then I want 
the output xml to look like this:

      <VehInfo>
              <ModelYear>2004</ModelYear>
              <Model>Ford</Model>
      </VehInfo>

Any help would be greatly appreciated!
thanks....gary...

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>