473,799 Members | 3,270 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Select element value based on attribute values in XML.

2 New Member
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.M anageMeterReads .ServiceContrac ts.CommonEntiti es.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 4226
jkmyoung
2,057 Recognized Expert Top Contributor
Look for the name attribute at the node you currently are condition testing.
[contains(@name, $type-local-name)]
Mar 24 '09 #2
abhijeetraje
2 New Member
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 Recognized Expert Moderator Expert
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
7724
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 when CH1 and CH2 have been choosen. $_GET gives me "CH2". Is there any way to get all the choosen channels elements? I would be very appreciative for any help. Thank you in anticipation. Regards
0
1495
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> <xs:restriction base="xs:token"> <xs:enumeration value="volume_number"/> <xs:enumeration value="page_range"/>
4
1508
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>: ....<subject>Accounting</subject> <subject>Business</subject>.. I can apply one stylesheet "Accountingfilter.xsl" that does this :
5
2179
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 1</option> <option value="1" selected >Connected Unit 2</option> </select> <span onclick="NewWindow('pluginpage.html?EditUnitGUID='+this.form.PlantUnitID.options.value+'&DoPostBack=1','namexx',200,310);"
2
12830
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 Select list. This is what I tried. Any help is appreciated. ============== <script type="text/javascript"> function GetOptVal(OptVal)
2
3664
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 /////////////////////////////////////////////////////////////////////////////////////// <form action="whatever.php" method="post"> <select name="zip_code" onchange="makeRequest('getCity.php?state='+this.form.zip_code.options.value)" multiple="multiple" size="20">
4
2710
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 EITHER the "values" attribute or <valuesub-elements - but not both. I tried using a <choicewith two element definitions for "characteristic" with different content, but this is clearly not allowed in XSD. Does anyone have an answer? Thanks.
1
2008
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 auto-complete for the attribute values of an element when creating an XML document. I dont know how to define the relationship ! Scenario: When using a location element and selecting the school value for the type attribute I would like to restrict...
1
2565
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 value="some-element"/> <special-element value="some-element-two"/> </special-location>
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10490
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10238
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9077
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5589
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.