473,383 Members | 1,870 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,383 software developers and data experts.

XMLSchema problem with XML document

Samji
23
Hello. I have this XML document:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <vbtagsconf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3.     xsi:noNamespaceSchemaLocation="vbtags.xsd">    
  4.  
  5.     <vbtag name="bold" params="false" group="basic">
  6.         <regexp>\[/?b]</regexp>
  7.         <code>&lt;b&gt;</code>
  8.     </vbtag>
  9.     <vbtag name="italic" params="false" group="basic">
  10.         <regexp>\[/?i]</regexp>
  11.         <code>&lt;i&gt;</code>
  12.     </vbtag>
  13.  
  14. </vbtagsconf>
  15.  
I have this XMLSchema:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3.     <!-- root element -->
  4.     <xs:element name="vbtagsconf">
  5.         <xs:complexType>
  6.             <xs:sequence minOccurs="1" maxOccurs="unbounded">
  7.                 <!-- first tag with three attributes -->
  8.                 <xs:element name="vbtag">
  9.                     <xs:complexType>
  10.                         <xs:attribute name="name" type="xs:string"/>
  11.                         <xs:attribute name="params" type="xs:string"/>
  12.                         <xs:attribute name="group" type="xs:string"/>
  13.                     </xs:complexType>
  14.                 </xs:element>
  15.                 <!-- next two tags with no attributes -->
  16.                 <xs:element name="regexp" type="xs:string"/>
  17.                 <xs:element name="code" type="xs:string"/>
  18.             </xs:sequence>            
  19.         </xs:complexType>
  20.     </xs:element>
  21. </xs:schema>
  22.  
When I validate the document against the schema, I get this error message:
"No character data is allowed by content model". What does that mean? What have I done wrong?

Thanks in advance.
Jun 9 '07 #1
1 4373
Dököll
2,364 Expert 2GB
Hello. I have this XML document:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <vbtagsconf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  3.     xsi:noNamespaceSchemaLocation="vbtags.xsd">    
  4.  
  5.     <vbtag name="bold" params="false" group="basic">
  6.         <regexp>\[/?b]</regexp>
  7.         <code>&lt;b&gt;</code>
  8.     </vbtag>
  9.     <vbtag name="italic" params="false" group="basic">
  10.         <regexp>\[/?i]</regexp>
  11.         <code>&lt;i&gt;</code>
  12.     </vbtag>
  13.  
  14. </vbtagsconf>
  15.  
I have this XMLSchema:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  3.     <!-- root element -->
  4.     <xs:element name="vbtagsconf">
  5.         <xs:complexType>
  6.             <xs:sequence minOccurs="1" maxOccurs="unbounded">
  7.                 <!-- first tag with three attributes -->
  8.                 <xs:element name="vbtag">
  9.                     <xs:complexType>
  10.                         <xs:attribute name="name" type="xs:string"/>
  11.                         <xs:attribute name="params" type="xs:string"/>
  12.                         <xs:attribute name="group" type="xs:string"/>
  13.                     </xs:complexType>
  14.                 </xs:element>
  15.                 <!-- next two tags with no attributes -->
  16.                 <xs:element name="regexp" type="xs:string"/>
  17.                 <xs:element name="code" type="xs:string"/>
  18.             </xs:sequence>            
  19.         </xs:complexType>
  20.     </xs:element>
  21. </xs:schema>
  22.  
When I validate the document against the schema, I get this error message:
"No character data is allowed by content model". What does that mean? What have I done wrong?

Thanks in advance.
Hello, Samji!

Just to be sure, could you look to see if your XML file is also saved as UTF-8?
Jun 10 '07 #2

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

Similar topics

3
by: Russell Lear | last post by:
I need to be able to unmarshall data from an XML file into (instances of) appropriate Python classes . I don't have control over the schema used. I'd like the Python classes to use lists for...
1
by: Mattias | last post by:
How do I assign several XSDs to a XML document? /Mattias
0
by: BODIN | last post by:
I have an XML document, which is actually physically stored in 2 separated files. doc1.xml and doc2.xml I NEED a WAY FOR THIS SIMPLE NEED : XML file splitted into two physical files, and use...
2
by: AlexS | last post by:
Hello, I have error when reading schema using XmlSchema. Read and then .Compile: System.Xml.Schema.XmlSchemaException: May not be nominated as the {substitution group affiliation} of any...
1
by: Eric | last post by:
I have code that creates, names, and adds to the the XmlSchema an XmlSchemaSimpleType. The code then creates an XmlSchemaElement and sets its SchemaType to the above XmlSchemaSimpleType. It works...
1
by: Victor Hadianto | last post by:
Hi, I have a simple XSD for example like this: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="qualified">...
2
by: Chris | last post by:
I'd like to be able to access the elements in an XSD/XmlSchema object to determine things like the datatype. Can this be done without explicitly running validation on a document? Can I...
1
by: Beanweed | last post by:
I am writing a web service in C#. One method queries a database for xml formatted data and responds to the requester with an XMLDocument (this part works fine). What I want now is another method...
1
by: Ryan | last post by:
Hello Xml Gurus, I'm trying to build an XML schema in memory using the System.Xml.XmlSchema namespace objects, validate it, and then write it to a file. The problem I'm facing is that...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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.