PC Review


Reply
Thread Tools Rate Thread

xml and namespace

 
 
Tony
Guest
Posts: n/a
 
      13th Feb 2012
Hello!

I can't understand why I get warning on the Xml file below.
The warning is: The element 'p' in namespace 'http://www.w3.org/1999/xhtml'
has invalid child element 'name' in namespace
'http://www.sernaferna.com/employees'. List of possible elements expected:
'a, br, span, bdo, map, object, img, tt, i, b, big, small, em, strong, dfn,
code, q, samp, kbd, var, cite, abbr, acronym, sub, sup, input, select,
textarea, label, button, ins, del, script' in namespace
'http://www.w3.org/1999/xhtml'.
C:\Users\Tony\programmering\Websites\slask5\XMLFile.xml 7 25 C:\...\slask5\


<?xml version="1.0" ?>
<emp:employee xmlns:emp="http://www.sernaferna.com/employees"
xmlns:html="http://www.w3.org/1999/xhtml">
<emp:name>Jane Doe</emp:name>
<emp:notes>
<html>
I've worked with <emp:name>Jane Doe</emp:name> for over a
<em>year</em> now.
</html>
</emp:notes>
</emp:employee>

//Tony

 
Reply With Quote
 
 
 
 
Arne Vajh°j
Guest
Posts: n/a
 
      15th Feb 2012
On 2/13/2012 4:45 PM, Tony wrote:
> I can't understand why I get warning on the Xml file below.
> The warning is: The element 'p' in namespace
> 'http://www.w3.org/1999/xhtml' has invalid child element 'name' in
> namespace 'http://www.sernaferna.com/employees'. List of possible
> elements expected: 'a, br, span, bdo, map, object, img, tt, i, b, big,
> small, em, strong, dfn, code, q, samp, kbd, var, cite, abbr, acronym,
> sub, sup, input, select, textarea, label, button, ins, del, script' in
> namespace 'http://www.w3.org/1999/xhtml'.
> C:\Users\Tony\programmering\Websites\slask5\XMLFile.xml 7 25 C:\...\slask5\
>
>
> <?xml version="1.0" ?>
> <emp:employee xmlns:emp="http://www.sernaferna.com/employees"
> xmlns:html="http://www.w3.org/1999/xhtml">
> <emp:name>Jane Doe</emp:name>
> <emp:notes>
> <html>
> I've worked with <emp:name>Jane Doe</emp:name> for over a <em>year</em>
> now.
> </html>
> </emp:notes>
> </emp:employee>


The error message is:

"The element 'p' in namespace
'http://www.w3.org/1999/xhtml' has invalid child element 'name' in
namespace 'http://www.sernaferna.com/employees'"

If you substitute the namespaces you get:

"The element 'html'
has invalid child element 'emp:name'"


Which means that you can not have an emp:name element
inside a html element.

This is defined in the schemas.

Arne


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
XML Serialization - Remove XML-instance namespace? Spam Catcher Microsoft C# .NET 6 23rd May 2008 11:36 AM
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel Microsoft C# .NET 7 17th Mar 2007 11:29 AM
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel Microsoft Dot NET Framework 5 17th Mar 2007 10:11 AM
what encoding does system.xml.xmldocument.save(string path) use to save the xml document if there is no <?xml... in the front of the xml document? Daniel Microsoft Dot NET 1 15th Mar 2007 10:37 AM
How to read the xml namespace of a xml document AA Microsoft Dot NET Framework 0 16th Aug 2003 12:10 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:43 AM.