473,830 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Use of following to get unique nodes???

In the below example I am using the following to try to match only the
unique MechanismText nodes within each Subscription node:

select="Deliver yPreferences/DeliveryPrefere nce[not(MechanismTe xt=following::
MechanismText)]"
Right now, the 2nd select populates correctly, but the 1st select is empty.
I know what is going on, but I don't know how to correct it.

I would appreciate any ideas, solutions or pointers you can give me.

Thanks, John

After the transformation, I should have two select lists...one for each
Subscription node.

1st Select:
<select>
<option>Email </option>
<option>Fax</option>
</select>

2nd Select:
<select>
<option>Email </option>
<option>Fax</option>
</select>
XSL TEMPLATES
<xsl:template mode="standard"
match="/myRoot/Response/Subscriptions/Subscription">
<select>
<xsl:apply-templates mode="optionbui lder"
select="Deliver yPreferences/DeliveryPrefere nce[not(MechanismTe xt=following::
MechanismText)]" />
</select>
</xsl:template>

<xsl:template mode="optionbui lder"
match="Delivery Preferences/DeliveryPrefere nce[not(MechanismTe xt=following::M
echanismText)]">
<xsl:element name="option">
<xsl:choose>
<xsl:when test="..//UserPreferenceF lag = 'Y'">
<xsl:if test="UserPrefe renceFlag = 'Y'">
<xsl:attribut e name="selected" >selected</xsl:attribute>
</xsl:if>
</xsl:when>
<xsl:otherwis e>
<xsl:if test="DefaultPr eferenceFlag = 'Y'">
<xsl:attribut e name="selected" >selected</xsl:attribute>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:attribut e name="value"><x sl:value-of
select="Mechani smCode"/></xsl:attribute>
<xsl:if test="Mechanism Text != 'NONE'">
<xsl:value-of select="Mechani smText"/>
</xsl:if>
</xsl:element>
</xsl:template>

HERE IS THE XML
<myRoot>
<Response>
<Subscription s>
<Subscription >
<DeliveryPrefer ences>
<DeliveryPrefer ence>
<TypeCode>10</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 10</FrequencyCode>
<FrequencyText> 1st day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>11</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 11</FrequencyCode>
<FrequencyText> 2nd day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>100 </TypeCode>
<MechanismCode> 7</MechanismCode>
<MechanismText> Fax</MechanismText>
<FrequencyCode> 1</FrequencyCode>
<FrequencyText> Month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>101 </TypeCode>
<MechanismCode> 7</MechanismCode>
<MechanismText> Fax</MechanismText>
<FrequencyCode> 2</FrequencyCode>
<FrequencyText> Quarterly</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>Y</UserPreferenceF lag>
</DeliveryPrefere nce>
</DeliveryPrefere nces>
</Subscription>
<Subscription >
<DeliveryPrefer ences>
<DeliveryPrefer ence>
<TypeCode>10</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 10</FrequencyCode>
<FrequencyText> 1st day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>11</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 11</FrequencyCode>
<FrequencyText> 2nd day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>12</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 12</FrequencyCode>
<FrequencyText> 3rd day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>40</TypeCode>
<MechanismCode> 1</MechanismCode>
<MechanismText> Email</MechanismText>
<FrequencyCode> 40</FrequencyCode>
<FrequencyText> 31st day of the month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>Y</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>100 </TypeCode>
<MechanismCode> 7</MechanismCode>
<MechanismText> Fax</MechanismText>
<FrequencyCode> 1</FrequencyCode>
<FrequencyText> Month</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
<DeliveryPrefer ence>
<TypeCode>101 </TypeCode>
<MechanismCode> 7</MechanismCode>
<MechanismText> Fax</MechanismText>
<FrequencyCode> 2</FrequencyCode>
<FrequencyText> Quarterly</FrequencyText>
<DefaultPrefere nceFlag/>
<UserPreference Flag>N</UserPreferenceF lag>
</DeliveryPrefere nce>
</DeliveryPrefere nces>
</Subscription>
</Subscriptions>
</Response>
</myRoot>
Jul 20 '05 #1
0 1377

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
2199
by: les_ander | last post by:
Hi, I have many set objects some of which can contain same group of object while others can be subset of the other. Given a list of sets, I need to get a list of unique sets such that non of the set is an subset of another or contain exactly the same members. Tried to do the following: s1=set() s2=set() s3=set()
4
6575
by: Victor Engmark | last post by:
When looking for a method to fetch unique elements and counting the number of occurences of each of them, I found quite a lot of gross examples of complex XSL. But after realizing the subtle difference between "." and "current()", I found a neat way of doing the same without keys or generate-id(): <xsl:template match="/"> <!-- Selects all "new" elements --> <xsl:for-each select="//Name"> <!-- Display the element -->
9
2437
by: Rolf Kemper | last post by:
Dear Experts, I got stuck with the following problem and need your help. What I wnat to do is to get a set of distinct nodes. Before the distinct I have selected the multiple occourences already sucsessfully. However , the rest does not work as expected. Hope someone can help on that. Rolf
2
3696
by: Chirag | last post by:
How to create unique id in xml documents using API? Are there any Microsoft APIs available to generate Unique IDs in XML Documents? Thanks in advance, Chirag
0
1069
by: Anas M. Nebuchadnezzar XXXVII | last post by:
I'm not sure if this is the right forum to ask this, seeing this problem is pretty much straight XSL, but here goes. I'm writting a simple employee database, and I want to be able to: A) get a node-set returning only unique values based off of a query. (the names of all the managers) b) loop through each of the nodes, sorted by the list of the managers. My Xml looks something like this:
3
2711
by: Kilroy Programmer | last post by:
Is there a way to store a unique numeric identifier (say, for example, an int) into a TreeNode, so that when the TreeNode is checked (since CheckBoxes is enabled) the eventhandler AfterCheck() can examine the responsible Node's identifier to see which TreeNode triggered the event? Analyzing the Node's Text string is undesirable because it would mean performing a string compare to a set of predefined strings. This is slower and not easily...
2
1895
by: smachin1000 | last post by:
Hi All, In the sample schema & document below, I'd like the attribute "name" to be unique for all function elements under function_list. The tools I'm using (XML Spy and xmllint) all validate the sample document and do not pick up that the name is not unique. Any clues as to what could be going wrong? Thanks.
1
3238
by: Zachary Turner | last post by:
I have a bunch of nodes like this: <a> <b> <b> <c> </a> <a> <b>
4
4267
by: Rob Stevens | last post by:
Is there some sort of unique identifier in every treenode that is consistent? I was looking at the handle of every treenode, but it appears that the handle changes everytime the tree is built. I have seen in some databases where they store the treenodes they are using some serial number of the node. I don't have a clue what that is, but can someone tell me if there is something that is unique to every node.
0
10763
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...
0
10473
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10196
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9307
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...
1
7737
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5614
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
5772
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4407
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
3
3070
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.