Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML problem with url value &F&

Reply
Thread Tools

XML problem with url value &F&

 
 
gg
Guest
Posts: n/a
 
      03-24-2007
I specify the Url element as
<xsd:element name="Url">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="512"/>
<xsdattern value="http://[a-zA-z.\\_\-]+"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
in the xsd but When I use the following in the xml

<Url>https://www.xyz.com/cgi-bin/access/a...&F21=IB&F22=IB
&REQUEST=ClientSignin&LANGUAGE=ENGLISH</Url>


I got the error message
The reference to entity "F7" must end with the ';' delimiter. [17]
so I tried surrounding the url with double quote, then tried \ before &f7
but no luck. even \\&f7 did not help

tried google on a number of search terms but no luck so far


 
Reply With Quote
 
 
 
 
Richard Tobin
Guest
Posts: n/a
 
      03-24-2007
In article <PFgNh.8212$__3.1414@edtnps90>, gg <(E-Mail Removed)> wrote:

>I specify the Url element as
> <xsd:element name="Url">


.... it's nothing to do with the schema.

>in the xsd but When I use the following in the xml
>
><Url>https://www.xyz.com/cgi-bin/access/a...&F21=IB&F22=IB
>&REQUEST=ClientSignin&LANGUAGE=ENGLISH</Url>


You can't do that in XML. You have to replace your ampersands with
"&amp;".

-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
 
Reply With Quote
 
 
 
 
gg
Guest
Posts: n/a
 
      03-24-2007
thank you. I just have to remember replacing & with &amp;.


"Richard Tobin" <(E-Mail Removed)> wrote in message
news:eu472r$11k7$(E-Mail Removed)...
> In article <PFgNh.8212$__3.1414@edtnps90>, gg <(E-Mail Removed)> wrote:
>
> >I specify the Url element as
> > <xsd:element name="Url">

>
> ... it's nothing to do with the schema.
>
> >in the xsd but When I use the following in the xml
> >

>
><Url>https://www.xyz.com/cgi-bin/access/a...B&F21=IB&F22=I

B
> >&REQUEST=ClientSignin&LANGUAGE=ENGLISH</Url>

>
> You can't do that in XML. You have to replace your ampersands with
> "&amp;".
>
> -- Richard
> --
> "Consideration shall be given to the need for as many as 32 characters
> in some alphabets" - X3.4, 1963.



 
Reply With Quote
 
Simon Brooke
Guest
Posts: n/a
 
      03-25-2007
in message <PFgNh.8212$__3.1414@edtnps90>, gg ('(E-Mail Removed)') wrote:

> I specify the Url element as
> <xsd:element name="Url">
> <xsd:simpleType>
> <xsd:restriction base="xsd:string">
> <xsd:maxLength value="512"/>
> <xsdattern value="http://[a-zA-z.\\_\-]+"/>
> </xsd:restriction>
> </xsd:simpleType>
> </xsd:element>
> in the xsd but When I use the following in the xml
>
>

<Url>https://www.xyz.com/cgi-bin/access/a...&F21=IB&F22=IB
> &REQUEST=ClientSignin&LANGUAGE=ENGLISH</Url>
>
>
> I got the error message
> The reference to entity "F7" must end with the ';' delimiter. [17]
> so I tried surrounding the url with double quote, then tried \ before
> &f7 but no luck. even \\&f7 did not help


The (traditional) use of ampersand as a parameter-value pair separator in
URLs is a mistake. Many (but not all) dynamic content toolkits allow the
use of other characters, for example semi-colon, which do not provoke this
problem. However, if you must use ampersand, the correct way of writing
ampersand in an XML document is '&amp;'. So you will find that

<Url>https://www.xyz.com/cgi-bin/access/a...=IB&amp;F22=IB
&amp;REQUEST=ClientSignin&amp;LANGUAGE=ENGLISH</Url>

will work.

--
http://www.velocityreviews.com/forums/(E-Mail Removed) (Simon Brooke) http://www.jasmine.org.uk/~simon/

;; 'I think we should trust our president in every decision
;; that he makes and we should just support that'
;; Britney Spears of George W Bush, CNN 04:09:03

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Getting ID, calling url, search for value, return value Tim Fröglich ASP .Net Web Services 1 01-10-2006 09:18 PM
URL - substitution of a correct URL by a GUID like URL in favorites. Just D. ASP .Net Mobile 0 08-11-2004 04:26 PM
redirect URL's, return URL's, and URL Parameters Jon paugh ASP .Net 1 07-10-2004 05:29 AM



Advertisments