473,403 Members | 2,323 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Select element value based on attribute values in XML.

I am applying XSLT to WSDL to generate html pages.

now, as WSDL is not having comprehensive details, i am adding XML documentation (.NET) as well in XSLT.
like this..
Expand|Select|Wrap|Line Numbers
  1. <xsl:variable name="ddoc" select="document('CustomerCare.ManageMeterReads.ServiceContracts.xml')" />
Here is the XML documentation....
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <doc>
  3. <assembly>
  4. <name>CustomerCare.ManageMeterReads.ServiceContracts</name>
  5. </assembly>
  6. <members>
  7. <member name="T:abc.pqr.test.CustomerCare.ManageMeterReads.ServiceContracts.CommonEntities.EmployeeID">
  8. <summary>
  9. Holds the configuration details for each Service.
  10. </summary>
  11. </member>
  12. </members>
  13. </doc>

WSDL is having element types e.g. EmployeeID ( i am able to extract the element types from XSDL, storing it in $type-local-name) however the description of that element is in above xml. my requirement is to get the "summary" element from above xml based on the member/name attribute.

WSDL just contain "EmployeeID" not full value "T:abc.pqr.test.CustomerCare.ManageMeterReads.Serv iceContracts.CommonEntities.EmployeeID".

I tried this... but not working...
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select="$ddoc/doc/members/member[contains($ddoc/doc/members/member/@name,$type-local-name)]/summary"/>
Mar 24 '09 #1
3 4216
jkmyoung
2,057 Expert 2GB
Look for the name attribute at the node you currently are condition testing.
[contains(@name,$type-local-name)]
Mar 24 '09 #2
I tried this...
<xsl:value-of select="$ddoc/doc/members/member[@name='contains(@name,$type-local-name']/summary"/>

however its not showing any results.

i want to extract summary element in $ddoc where attribute "name" is having value that contains $type-local-name'
Mar 25 '09 #3
Dormilich
8,658 Expert Mod 8TB
I think jkmyoung was rather proposing this
Expand|Select|Wrap|Line Numbers
  1. <xsl:value-of select="$ddoc/doc/members/member[contains(@name,$type-local-name)]/summary"/>
Mar 25 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Rolf Wester | last post by:
Hi, I have a form with a select element with multiple="true". When using the GET method (I suppose the same happens with the POST method) I can seen that the form sends channels=CH1&channels=CH2...
0
by: Ingrid | last post by:
Am I right in thinking that datatyping at element level ie <xs:element name="num" type="xs:integer"> and specifying a choice of attribute values ie <xs:attribute name="kind"> <xs:simpleType>...
4
by: celerystick | last post by:
This is an xsl question, comp.infosystems.www.authoring.stylesheets were not able to help , here goes .... With one xml file containing repeated element <subject>: ...
5
by: GTi | last post by:
Whats wring with this code? <select class=EditField size="1" name="PlantUnitID" title="Select line"> <option value="0" >Standalone Unit</option> <option value="1" selected >Connected Unit...
2
by: bigrich | last post by:
I'm a beginner to javascript and need help. I've searched the forum but can't piece the answer together. I need to be able to uncheck and disable a checkbox based on the option selected in a...
2
by: areef.islam | last post by:
Hi, I am kinda new to javascript and I am having this problem with selecting multiple options from a select tag. Hope someone can help me out here. here is my code...
4
by: Eric | last post by:
Attached is an example of my question. Note the "values" attribute is optional. Also the <valuesub-element is optional. Here, the XML can contain, 1 or both or neither. I would like to allow...
1
by: JavaXMLDev | last post by:
Hi I'm new to XML schema work, but wondered how, if at all possible, can you specify a relationship between the values of an element's attributes. Essentially I want context sensitive...
1
by: Zachary Turner | last post by:
I want to select some nodes based on whether or not another node exists in another part of the document with the exact same name. For example, <special-location> <special-element...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.