473,824 Members | 3,045 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

error "End tag does not match start tag"

10 New Member
I have the following xsl:
=============== =============== =
Expand|Select|Wrap|Line Numbers
  1.   <xsl:for-each select="ROWSET/ROW">
  2.    <xsl:choose>
  3.    <!-- previous node is blank, this is the first node -->
  4.     <xsl:when test="preceding-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
  5.         <FacilitySiteAllDetails>
  6.             <FacilitySite>
  7.                 <FacilitySiteName>
  8.                     <xsl:value-of select="FS_FACILITYSITENAME"/>
  9.                 </FacilitySiteName>
  10.             </FacilitySite>
  11.             <StateFacilityIdentifier>
  12.                 <xsl:value-of select="FS_STFACILITYIDENTIFIER"/>
  13.             </StateFacilityIdentifier>
  14.    <!-- the next facility ID is different, need to close tag -->
  15.      <xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER!=FS_STFACILITYIDENTIFIER">
  16.             </FacilitySiteAllDetails>
  17.         </xsl:when>
  18.    <!-- next node is blank, this is the last node -->
  19.         <xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
  20.             </FacilitySiteAllDetails>
  21.         </xsl:when>
  22.     </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.
Jun 12 '07 #1
5 41151
dorinbogdan
839 Recognized Expert Contributor
I think that you missed the <xsl:choose> element around the last 2 <xsl:when> statements
Expand|Select|Wrap|Line Numbers
  1. ....
  2.     <!-- the next facility ID is different, need to close tag -->
  3.     <xsl:choose>
  4.         <xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER!=FS_STFACILITYIDENTIFIER">
  5.             </FacilitySiteAllDetails>
  6.         </xsl:when>
  7.         <!-- next node is blank, this is the last node -->
  8.         <xsl:when test="following-sibling::*[1]/FS_STFACILITYIDENTIFIER=''">
  9.             </FacilitySiteAllDetails>
  10.         </xsl:when>
  11.     </xsl:choose>
  12. </xsl:when>
Jun 13 '07 #2
cfli1688
10 New Member
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.
Jun 13 '07 #3
dorinbogdan
839 Recognized Expert Contributor
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.
Jun 14 '07 #4
mohammeda
1 New Member
you can use
<xsl:text disable-output-escaping='yes'> &lt;TagName&gt; </xsl:text>
instead of <TagName>
Nov 25 '07 #5
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:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">.
  3. <xsl:for-each select="ROWSET/ROW[not(FS_STFACILITYIDENTIFIER = preceding-sibling::*[1]/FS_STFACILITYIDENTIFIER)]">
  4.         <!-- previous node is different, this is the first node -->
  5.         <FacilitySiteAllDetails>
  6.             <FacilitySite>
  7.                 <FacilitySiteName>
  8.                     <xsl:value-of select="FS_FACILITYSITENAME"/>
  9.                 </FacilitySiteName>
  10.             </FacilitySite>
  11.             <StateFacilityIdentifier>
  12.                 <xsl:value-of select="FS_STFACILITYIDENTIFIER"/>
  13.             </StateFacilityIdentifier>
  14.         </FacilitySiteAllDetails>
  15.     </xsl:for-each>
  16. </xsl:stylesheet>
  17.  
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.
Nov 26 '07 #6

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

Similar topics

6
9777
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;
3
8877
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,
6
1989
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?
4
2727
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...
5
8093
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
2
5127
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...
7
13387
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...
1
35089
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 :-
0
998
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"...
0
10731
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
10489
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
10178
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
9281
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
5597
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
5754
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4391
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
3932
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3061
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.