Wednesday, March 7, 2012

encoding iso-8859-1

Hi Folks
to accomodate an xml file that's encoded iso-8859-1, what do I need to
change in my .xsd code (below):
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
it looks like XMLSchema.xsd is 'wired' as utf-8. (I tried copying
XMLSchema.xsd, XMLSchema.DTD, datatypes.DTD locally and changing the encoding
in XMLSchema.xsd to iso-8859-1, but this causes other problems with simple
data type validations.)
thanks Rob
Did you add the XML declaration:
<?xml version="1.0" encoding="iso-8859-1"?>
in the beginning?
Best regards
Michael
"RobKaratzas" <RobKaratzas@.discussions.microsoft.com> wrote in message
news:1EF8BE76-F750-47D4-BA3C-6F785744C5B5@.microsoft.com...
> Hi Folks
> to accomodate an xml file that's encoded iso-8859-1, what do I need to
> change in my .xsd code (below):
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:sql="urn:schemas-microsoft-com:mapping-schema">
> --
> it looks like XMLSchema.xsd is 'wired' as utf-8. (I tried copying
> XMLSchema.xsd, XMLSchema.DTD, datatypes.DTD locally and changing the
> encoding
> in XMLSchema.xsd to iso-8859-1, but this causes other problems with simple
> data type validations.)
> thanks Rob
>
|||Hi Michael
I added this to the first line (in both the .xsd AND the .XML file). The
..XML file validates just fine, however, the .xsd (which I've copied locally,
with the DTDs) comes up with:
C:\Inetpub\wwwroot\XMLSchema.xsd(1359): Restriction of anySimpleType is not
allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1359, 4).
C:\Inetpub\wwwroot\XMLSchema.xsd(1381): Restriction of anySimpleType is not
allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1381, 4).
C:\Inetpub\wwwroot\XMLSchema.xsd(1400): Restriction of anySimpleType is not
allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1400, 4).
C:\Inetpub\wwwroot\XMLSchema.xsd(1424): Restriction of anySimpleType is not
allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1424, 4).
(The SimpleType definitions fail to validate.)
For the time being, there are only several instances in the XML files where
these characters appear (I think this is more of an error with the source,
than design), so I can remove them.
But eventually, I'd like to find a solution to this.
Thanks Rob
"Michael Rys [MSFT]" wrote:

> Did you add the XML declaration:
> <?xml version="1.0" encoding="iso-8859-1"?>
> in the beginning?
> Best regards
> Michael
> "RobKaratzas" <RobKaratzas@.discussions.microsoft.com> wrote in message
> news:1EF8BE76-F750-47D4-BA3C-6F785744C5B5@.microsoft.com...
>
>
|||I'm sorry, I failed to mention these facts:
1. The validation issues come up in VS.NET 2003
2. I can browse the XMLSchema (http://localhost/XMLSchema.xsd) w/o issue
(with only inserting <?xml version="1.0" encoding="iso-8859-1"?> into the .vsd
Thanks Rob
"Michael Rys [MSFT]" wrote:

> Did you add the XML declaration:
> <?xml version="1.0" encoding="iso-8859-1"?>
> in the beginning?
> Best regards
> Michael
> "RobKaratzas" <RobKaratzas@.discussions.microsoft.com> wrote in message
> news:1EF8BE76-F750-47D4-BA3C-6F785744C5B5@.microsoft.com...
>
>
|||The error message "Restriction of anySimpleType is not
allowed" indicates that the schema contains an error. You should fix the
schema (and use the general xml newsgroup or post the offending type
restriction for more help).
HTH
Michael
"RobKaratzas" <RobKaratzas@.discussions.microsoft.com> wrote in message
news:50F3E074-06A5-4DE8-A56E-36345FD40E0F@.microsoft.com...[vbcol=seagreen]
> Hi Michael
> I added this to the first line (in both the .xsd AND the .XML file). The
> .XML file validates just fine, however, the .xsd (which I've copied
> locally,
> with the DTDs) comes up with:
> C:\Inetpub\wwwroot\XMLSchema.xsd(1359): Restriction of anySimpleType is
> not
> allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1359, 4).
> C:\Inetpub\wwwroot\XMLSchema.xsd(1381): Restriction of anySimpleType is
> not
> allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1381, 4).
> C:\Inetpub\wwwroot\XMLSchema.xsd(1400): Restriction of anySimpleType is
> not
> allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1400, 4).
>
> C:\Inetpub\wwwroot\XMLSchema.xsd(1424): Restriction of anySimpleType is
> not
> allowed. An error occurred at C:\Inetpub\wwwroot\XMLSchema.xsd, (1424, 4).
> (The SimpleType definitions fail to validate.)
> For the time being, there are only several instances in the XML files
> where
> these characters appear (I think this is more of an error with the source,
> than design), so I can remove them.
> But eventually, I'd like to find a solution to this.
> Thanks Rob
> "Michael Rys [MSFT]" wrote:

No comments:

Post a Comment