I have the following xsl:
=============== =============== = - <xsl:for-each select="ROWSET/ROW">
-
<xsl:choose>
-
<!-- previous node is blank, this is the first node -->
-
<xsl:when test="preceding-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
-
<FacilitySiteAllDetails>
-
<FacilitySite>
-
<FacilitySiteName>
-
<xsl:value-of select="FS_FACILITYSITENAME"/>
-
</FacilitySiteName>
-
</FacilitySite>
-
<StateFacilityIdentifier>
-
<xsl:value-of select="FS_STFACILITYIDENTIFIER"/>
-
</StateFacilityIdentifier>
-
<!-- the next facility ID is different, need to close tag -->
-
<xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER!=FS_STFACILITYIDENTIFIER">
-
</FacilitySiteAllDetails>
-
</xsl:when>
-
<!-- next node is blank, this is the last node -->
-
<xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
-
</FacilitySiteAllDetails>
-
</xsl:when>
-
</xsl:when>
=============== =============== ==
But, when I try to run it again my xml document, it gives me the error "End tag does not match start tag" on line 16.
How do I get around this error?
Thanks.
5 41151
I think that you missed the <xsl:choose> element around the last 2 <xsl:when> statements - ....
-
<!-- the next facility ID is different, need to close tag -->
-
<xsl:choose>
-
<xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER!=FS_STFACILITYIDENTIFIER">
-
</FacilitySiteAllDetails>
-
</xsl:when>
-
<!-- next node is blank, this is the last node -->
-
<xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
-
</FacilitySiteAllDetails>
-
</xsl:when>
-
</xsl:choose>
-
</xsl:when>
Its there in the full script, I just did not include the whole script.
If you look at lines 15-17, I am using a condition to display the close tag for the xml output:
<xsl:when ...>
</closeTagForXML>
</xsl:when>
Because of the close tag for the XML document, the xsl document is now ill-formed, and the JVM is complaint about this. Is this the correct way to use the xsl:when to selectively insert tags into the resulting XML document? If yes, how can I get around the ill-formed XSL? If not, how should I approach this conditional tagging?
Thanks.
Yes, I observed too that problem.
Eventually try to set the output format as text instead of xml, in order to bypass the xml validation. If the < and > are not allowed, use & l t ; and & g t ; instead.
you can use
<xsl:text disable-output-escaping='yes'> <TagName> </xsl:text>
instead of <TagName>
jkmyoung 2,057
Recognized Expert Top Contributor
I highly recommend not doing that. Moreover, you will probably only ever have one FacilitySiteAll Details using your current code.
Are you outputting any of the other identifiers per category or just the first?
As it is, the following would probably fulfill what you're outputting right now: -
<?xml version="1.0" encoding="UTF-8"?>
-
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">.
-
<xsl:for-each select="ROWSET/ROW[not(FS_STFACILITYIDENTIFIER = preceding-sibling::*[1]/FS_STFACILITYIDENTIFIER)]">
-
<!-- previous node is different, this is the first node -->
-
<FacilitySiteAllDetails>
-
<FacilitySite>
-
<FacilitySiteName>
-
<xsl:value-of select="FS_FACILITYSITENAME"/>
-
</FacilitySiteName>
-
</FacilitySite>
-
<StateFacilityIdentifier>
-
<xsl:value-of select="FS_STFACILITYIDENTIFIER"/>
-
</StateFacilityIdentifier>
-
</FacilitySiteAllDetails>
-
</xsl:for-each>
-
</xsl:stylesheet>
-
Insert a for-each select="..\ROW[FS_STFACILITYID ENTIFIER = current()/FS_STFACILITYID ENTIFIER" statement to get the all of the Rows in a Facility Site, once you have the first one.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: kelvSYC |
last post by:
This little bit of seeminly innocent code seems to give me these two
errors, all on the line that declares check(). Is there some part of
C++ that I'm missing out on?
class Condition {
public:
Condition() {}
virtual ~Condition() {}
virtual bool check() const;
|
by: Robert |
last post by:
---EN---
This message has been crossposted in a french speaking newsgroup,
english version is at the end. Thanks a lot for your help...
--/EN---
Bonjour,
Je développe une application intranet qui "tourne" maintenant depuis
plusieurs années auprès de 2500 personnes environ, mais depuis 1 mois,
|
by: **Developer** |
last post by:
I have a couple of instances where using "Auto" did not work so I tried the
"A" version of the DLL and it works.
Tried the "W" version and it doesn't.
Anyone have any idea why that might happen?
It is true that with XP Auto uses the "W" version is it not?
|
by: Don Wash |
last post by:
Hi All!
I'm getting the following Error:
No DLLs has been compiled yet and nothing in the \bin directory. So it is
not the versioning problem or anything like that.
And here are the source of the files...
|
by: Dmitriy Lapshin [C# / .NET MVP] |
last post by:
Hi all,
I think the VB .NET compiler should at least issue a warning when a function
does not return value. C# and C++ compilers treat this situation as an error
and I believe this is the right thing to do. And I wonder why VB .NET keeps
silence and makes such function return some default value instead. Isn't it
error-prone?
--
Dmitriy Lapshin
| |
by: Suresh |
last post by:
Hello All,
Can anyone help me with this error? I have developed an application
using VB Express Edition. The backend being Oracle XE.
The application is been published on the server, installation in the
clients are fine. When I start up the application, in this case, a
login screen. It throws up a error saying "value does not fall within
expected range". This is happening only on Win2000 machines. On XP it
works fine.
Installed .NET...
|
by: semedao |
last post by:
Hi,
I am using cryptostream on both sides on tcp connection that pass data.
I am also use asyc socket , so , the data that recieved in the callback
method not always have the length of the buffer I sent.
for ex
I want to send 10000 bytes
I can get it in 10 times of 1000 bytes each.
so , I need to know when I complete the receiving , I want to write inside
cryptostream and check the position compare it to the length I already know
I...
|
by: aberry |
last post by:
I have text file which contain Unicode data (say inp.txt)
I read file using following code:-
import codecs
infile = codecs.open('C:\\tdata\\inp.txt','r','utf-16',errors='ignore')
data = infile.readlines()
If I run above code ... it throws following error :-
|
by: Avinash Reddy |
last post by:
I have a WCF(REST) Service in the view mark up i added factory attribute like this:
Factory="System.ServiceModel.Activation.WebServiceHostFactory
in web.config i have ServiceModel tag like this:
<system.serviceModel>
<services>
<service name="distasio_wcf.DistasioWcfService" behaviorConfiguration="distasio_wcf.DistasioWcfServiceBehavior">
<endpoint address="" binding="webHttpBinding"...
|
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...
|
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,...
| |
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |