• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 976
  • Last Modified:

issue with an xslt transformation

Hi, you can refer to this question:
http://www.experts-exchange.com/Programming/Languages/C_Sharp/Q_22725368.html

It happens that, when I launch that xslt transformation I get the error:

"Character  '< ' is grammatically unexpected in column xxx at line xxx "

The point referenced by the error message is the '<' of the next <CURRICULUM> node

Any help is very welcome.
Thanks and regards
0
repzat
Asked:
repzat
  • 7
  • 5
1 Solution
 
R7AFCommented:
Can you give an example of the XML that results in this error? Maybe you have a '<' character in it? You should replace it with &lt;.
0
 
repzatAuthor Commented:
Hi, thanks. Do you have an email address where I can send you the a complete node ?

Best Regards
0
 
R7AFCommented:
You can use mediafire to upload your stuff. Then post the link here. If you create an account, you can remove it later if you want to.
http://www.mediafire.com/
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
repzatAuthor Commented:
Hi, you can find the file here:

http://www.mediafire.com/?chxwayu1t9s

There are n <CURRICULUM> nodes

Thanks and regards
0
 
repzatAuthor Commented:
R7AF, please verify also that the output file is the same as the original one except - obiuosly - the nodes that match the condition that will be deleted.

Thanks
0
 
R7AFCommented:
I don't get an error. The output seems to be fine. It works like it should. Did you get the error with this exact XML?

What you can do is the following:

1) Change the "xxxx" everywhere into something different like "aaa", "bbb", "ccc", etc. Then the error message might inform you what the problem is.
2) If that doesn't work, start removing nodes, from ASSESSMENT to RESIDENCE. Then remove attributes from ANAGRAFIC. Do this step by step, everytime testing if it works. If it suddenly does, (e.g. when you removed STUDY), then restore the other nodes and attributes, testing if that causes an error. So pin it down to one node and attribute. Then try different values and see that causes an error.

NB: One thing I noticed is that if there is no CURRICULUM node with a name, then the XML has no root. So that will be a problem, but I think that's another one.
0
 
R7AFCommented:
Another NB: About my last remark... that depends on the rest of you xslt, if that's a problem or not.
0
 
repzatAuthor Commented:
Hi R7AF, thanks for that.

I am trying running the xslt using Atova XMLSpy and I still get that error.

Also I am seeing that the [CDATA] sections seem to have been removed.

Regards
0
 
repzatAuthor Commented:
And I get that error immediately at the beginiing of the first node <CURRICULUM> , i.e. where there the
 '<' of the next <CURRICULUM> node
0
 
repzatAuthor Commented:
sorry ... I get the error immediately at the *end* of the first node <CURRICULUM> , i.e. where there the
 '<' of the next <CURRICULUM> node
0
 
R7AFCommented:
I can't use Altova (no Windows). I use Xalan mostly. The CDATA can be a problem. You normally use that so you don't have to escape characters. But the transformation normally removes the CDATA.

See http://www.devguru.com/technologies/xslt/8454.asp

So you can try to use this at the top of your xslt. Replace namelist with the names of the elements that need to be cdata, space-separated. I believe you can do something like this in the XML as well, but am not sure.
<xsl:output cdata-section-elements="namelist"/>

(Haven't tried this myself!)
0
 
repzatAuthor Commented:
Hi, at the end I 'manually' removed the nodes using the tool Stylus Studio 2007.

It has a powerful function that allows you to execute a xPath query and then to remove the macthing nodes.

Thanks again for you support, at the end I solve my issue :)

Regards
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 7
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now