473,382 Members | 1,375 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

XSL Extracting Ampersand from XSD

I have an XML Schema Document (.xsd) that contains documentation tags
(specifically, custom tags subordinate xsd:appinfo). These
documentation tags contain strings that may contain ampersands. I have
written an XSL Document (.xls) to extract these values and output an
XML document including them on the screen. When I copy and paste the
result to an XML file (.xml) and test for well-formedness, I get an
error telling me that a semicolon (;) is required after the text that
follows the ampersand. This is because the parser is expecting an
escape code. Is there a way to extract this information and translate
the ampersand to & so that the resulting .xml document will be well
formed? I have tried using translate($var, '&', '&amp') but it just
balks at the first ampersand.

Oct 19 '06 #1
4 3052
ja*********@gmail.com wrote:
documentation tags contain strings that may contain ampersands
If there's an ampersand in your input document which is used for
anything other than an entity reference or a character reference, and is
not within a <[CDATA[]]section, the document is not legal XML.

Convert the ampersands to &amp; *BEFORE* asking XML tools to process
this data. (I'm of the opinion that <[CDATA[]]causes more problems
than it solves, and should be used only as a lazy man's solution when
hand-editing XML.)

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Oct 19 '06 #2
My understanding is that, within appinfo tags, any information is
considered extraneous data not processed by the XML processor. Hence,
why it is allowed to be in the source document and still be valid.

However, your point still stands. If it is not valid in the context of
the processable portion of an XML document, I suppose the XML parsing
tools can not be expected to handle it.
Joseph Kesselman wrote:
ja*********@gmail.com wrote:
documentation tags contain strings that may contain ampersands

If there's an ampersand in your input document which is used for
anything other than an entity reference or a character reference, and is
not within a <[CDATA[]]section, the document is not legal XML.

Convert the ampersands to &amp; *BEFORE* asking XML tools to process
this data. (I'm of the opinion that <[CDATA[]]causes more problems
than it solves, and should be used only as a lazy man's solution when
hand-editing XML.)

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Oct 19 '06 #3
ja*********@gmail.com wrote:
My understanding is that, within appinfo tags, any information is
considered extraneous data not processed by the XML processor. Hence,
why it is allowed to be in the source document and still be valid.
Validity is only tested after well-formedness is stested -- and an
isolated & is not well formed XML.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Oct 19 '06 #4
ja*********@gmail.com wrote:
My understanding is that, within appinfo tags, any information is
considered extraneous data not processed by the XML processor. Hence,
why it is allowed to be in the source document and still be valid.
Validity is only tested after well-formedness is tested -- and an
isolated & character is not well formed XML.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Oct 19 '06 #5

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

Similar topics

0
by: debk | last post by:
Server.UrlEncode is not longer converting the ampersand in a string to %26 so the value passed in the querystring gets truncated in the following page. Is this a problem with IIS, does anyone know?...
4
by: tfortney | last post by:
I created an iframe HtmlGenericControl that has an ampersand in the "src" attribute..... Dim faxFrame As New HtmlGenericControl("iframe") faxFrame.Attributes.Add("width", "100%")...
1
by: Prasanna Padmanabhan | last post by:
I want to process requests to certain image files that have a custom ..icon(32x32) extenstion with a custom .NET HttpHandler in order to be able to tap into Application events. This works fine...
1
by: klynn | last post by:
I have a web.config key as follows: <add key="DOC_TRAILER" value="&Lib=whatever&File=.pdf&Frameset=Created" /> but I cant run the app with this string. Problems with & I tried putting @ at...
3
by: Elroyskimms | last post by:
I have to encode an address which contains an ampersand (&) into a URL with various querystring parameters. The following code works fine: URLString = "www.myserver.com?AD1=" &...
6
by: Werner | last post by:
Hi, I try to read (and extract) some "self extracting" zipefiles on a Windows system. The standard module zipefile seems not to be able to handle this. False Is there a wrapper or has...
13
by: mark4asp | last post by:
When I write a url in xhtml, with an unencoded ampersand, like this: http://localhost:2063/Client/ViewReport.aspx?Ref=58&Type=SUMMARY the xhtml sytax checker correctly indicates an error,...
0
by: vlsidesign | last post by:
I am a newbie to C, and was hoping to get a little bit better handle on this until I get deeper into pointers, etc. I kind of understand it some, but still unfamiliar because I haven't got to...
4
by: Kiran Makam | last post by:
I am setting the content of a div dynamically using innerHTML property. If the content contains an ampersand, text after the ampersand is disappearing in IE6. It works properly in Firefox. This...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.