issue with XML and Schema namespace

Hi I am having a hard time with validation of my XML file with given schema.

Here are the files:

roboerrorlog.xsd

<robomss:schema xmlns:robomss="http://www.w3.org/2001/XMLSchema" 
xmlns="robomss"
  elementFormDefault="qualified" targetNamespace="robomss">
   <robomss:element name="roboErrorLog" type="errorLogType"/>
   <robomss:complexType name="errorLogType">
       <robomss:sequence maxOccurs="unbounded">
           <robomss:element name="error" type="errorType"/>
       </robomss:sequence>
   </robomss:complexType>
   <robomss:complexType name="errorType">
       <robomss:sequence>
           <robomss:element name="user" type="robomss:string"/>
           <robomss:element name="datetime" type="robomss:string"/>
    <robomss:element name="message" type="robomss:string"/>
    <robomss:element name="stack" type="stackType"/>
       </robomss:sequence>
   </robomss:complexType>
   <robomss:complexType name="stackType">
       <robomss:sequence>
           <robomss:element name="functionName" type="robomss:string"/>
           <robomss:element name="lineNumber" type="robomss:string"/>
       </robomss:sequence>
   </robomss:complexType>
</robomss:schema>


roboerrorlog.xml

<?xml version="1.0" encoding="utf-8"?>
<roboErrorLog xmlns:robomss="http://www.w3.org/2001/XMLSchema">
  <error>
    <user>steve</user>
    <datetime>12/18/2007 2:31:33 PM</datetime>
    <message>Null reference error!</message>
    <stack>
      <functionName>Void btnSearch_Click(System.Object, 
System.EventArgs)</functionName>
      <lineNumber>300</lineNumber>
    </stack>
  </error>
  <error>
    <user>steve</user>
    <datetime>12/18/2007 2:31:38 PM</datetime>
    <message>Null reference error!</message>
    <stack>
      <functionName>Void btnSearch_Click(System.Object, 
System.EventArgs)</functionName>
      <lineNumber>300</lineNumber>
    </stack>
  </error>
  <error>
    <user>steve</user>
    <datetime>12/18/2007 2:31:43 PM</datetime>
    <message>Null reference error!</message>
    <stack>
      <functionName>Void btnSearch_Click(System.Object, 
System.EventArgs)</functionName>
      <lineNumber>300</lineNumber>
    </stack>
  </error>
  <error>
    <user>steve</user>
    <datetime>12/18/2007 3:22:37 PM</datetime>
    <message>Null reference error!</message>
    <stack>
      <functionName>Void btnSearch_Click(System.Object, 
System.EventArgs)</functionName>
      <lineNumber>300</lineNumber>
    </stack>
  </error>
  <error>
    <user>steve</user>
    <datetime>12/18/2007 3:22:38 PM</datetime>
    <message>Null reference error!</message>
    <stack>
      <functionName>Void btnSearch_Click(System.Object, 
System.EventArgs)</functionName>
      <lineNumber>300</lineNumber>
    </stack>
  </error>
</roboErrorLog>

When I pass these files to a validator it has an issue with the roboErrorLog 
declaration.

Now the weird thing is if I change the namespace in the opening tag to 
xmlns="robomss" than the validator sees it as valid

So the valid tag looks like <roboErrorLog xmlns="robomss"> rather than
<roboErrorLog xmlns:robomss="http://www.w3.org/2001/XMLSchema">

If anyone knows what the issue is I'd appreciate your help. 


0
Durango2008
12/19/2007 9:51:39 AM
dotnet.xml 7266 articles. 0 followers. Follow

1 Replies
584 Views

Similar Articles

[PageSpeed] 17

Durango2008 wrote:

> <robomss:schema xmlns:robomss="http://www.w3.org/2001/XMLSchema" 
> xmlns="robomss"
>   elementFormDefault="qualified" targetNamespace="robomss">

As the targetNamespace of your schema is "robomss" and as 
elementFormDefault is "qualified" the schema defines all its elements in 
the namespace "robomss".
Thus for an XML instance document to be valid against the above schema 
you need to have
   <roboErrorLog xmlns="robomss">
or use some prefix (e.g. "rb")
   <rb:roboErrorLog xmlns:rb="robomss">

> <roboErrorLog xmlns:robomss="http://www.w3.org/2001/XMLSchema">

Why do you think that the XML instance document needs to use the XSD 
schema namespace "http://www.w3.org/2001/XMLSchema"? You need that in 
the schema to indicate you are authoring a schema in the W3C schema 
language but using that namespace in the instance document is not 
meaningful.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
12/19/2007 12:42:08 PM
Reply:

Similar Artilces:

Format issues
I have created a template in word which I call through a VB script from excel. The excel data is populated in the word every time I run this script. Everything works fine and the data get populated. I have a header in the template which is represents one of the fields in the excel sheet. The header shows the correct linked value for the first 10 pages but then on shows the variable name instead of the value. I have no idea why it does that? can someone help The code is as follows: For iCurrentRow = 1 To iLastRow If ActiveSheet.Range("B" & iCurrentRow...

Using XML DTD thru C#
Hi, I am a new to using xml class in c#.I am having a DTD/XSL(Xml-schema file) File.Now i need to insert the element values and attributes to that DTD/XSL and to produce a new xml file.Is it possible to craete an xml file from DTD/XSL using visual studio .Net 2003 or visual studio ..Net 2005.Now i am creating the XML file without DTD/XSL using XmlTextWriter.WriteStartElement XmlTextWriter.WriteAttributeString XmlTextWriter.WriteElementString XmlTextWriter.WriteEndElement Methods.Can anybody help me on this issue. Regards, Manikandan plmanikandan@gmail.com wrote: > I am a n...

Outlook issues after Exchange migration
We recently migrated Exchange 5.5 mailboxes to Exchange 2003 on a new domain. This was performed with the exmerge utility in a 2 step process. Now there are 2 issues with Oulook: 1) When a user types a recipient name into the address field, the name autocompletes as normal. But when the mail is sent, a message returns saying it is undeliverable. However, if the user goes into the Contacts folder and from there selects the same user to send a message to, it is successful. 2) If a user shares a calendar, specifying the user with whom to share and the level of permissions, all users in ...

LINQ to XML
This is my XML file: <?xml version="1.0" encoding="utf-8" ?> <Profiles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.mycompany.com/MyApp/2010/03/MySchema"> <Profile id="0" name="MyProfileName1"> <Entity name="EntityName1" type="EntityTypeName1"> <Shared> <Property name="SharedPropertyName1" type="SharedPropertyType1" /> <Property name="SharedPropertyName2" type="SharedProper...

Integration Manager XML Adapter?
Where can I find the XML adapter for the Integration Manager? We just upgraded our Integration Manager and GP to V10 and we cannot find the XML adapter on the new IM. Please let me know Thanks, If you're looking for the XML Source adapter, I think you'll find it with SP 2 -- Leslie Vail, CPA, MCT, MVP MCBSP-Application for Microsoft Dynamics GP MCBSP-Installation and Configuration for Microsoft Dynamics GP cell: 972-814-8550 fax: 972-692-7472 "Sean" wrote: > Where can I find the XML adapter for the Integration Manager? We just > upgraded our Integration...

Taskbar issue
Hello All I'm hoping someone can help me with this long-standing problem with both XP and Vista on separate laptops and every computer I've had (except I think Win98). I'm thinking there may be no solution, but what it's worth a try. With both of my machines, I have the taskbar (as well as other toolbars) set out to maximum size - typically half the screen - and to auto hide. (This makes a great program and file launcher) The issue is that the operating system decides it wants open the taskbar on its own from time to time on its own. Various things prompt this, ma...

DST issue
I entered the catalog item: <Feature Name="Item" CatalogItemId="Item:MS:sysgen_timesvc_dst" /> and confirmed that the device has the registry key: HKLM\Software\Microsoft\Clock\AutoDST = 1 But the device still does not automatically adjust for DST. I set the timezone to Pacific, set the time to 3/14/2010 at 1:59AM, waited for one minute...and the time changed to 2:00AM instead of 3:00AM. What am I missing? Thanks. which OS version are you using? have you updated it with the relevant qfes which deal with the changing in DST starting day? -...

Outlook/EX Email Issue
I'm running Windows XP with XP Professional. I cannot send email but I can recieve it using Outlook. There error says that Outlook was unable to access the SMTP server. I cannot access my email at HOME through the web email. What I can do is send/recieve email using Outlook Express AND I can access my email through my web email client outside my home. My ISP (SBC) says its not them and I'm somewhat inclined to agree with them? They say I could have a corrupted kernel32.dll file. I have turned off my Norton, deleted my account and set up a new one and re-installed XP professiona...

Extender Install Issues
GP 8.0 Extender install - I'm encountering the following: *Login to GP brings up screen: "Great Plains Extender needs to finish installing. This may take a few minutes". It has an OK button and clicking on this gets you into GP but it comes up everytime. How can we stop this from popping up all the time. *When creating a new Extender Window and I get select the Form, I get the following error: "A remove range operation on table 'PT_User_Defined_Window_Keys' failed accessing SQL data." Procedure or function zDP_EXT40101L_1 has too many arguments spec...

Possible Report Issue
Hi. I'm working on a database for a safety audit. The auditors would like to be able to use some of the tables and subtables as a sort of checklist for the audits. The table/subtable structure is as follows: Topic -->Subtopic -->ProgramArea -->ProgramRequirement I decided to create a report that will output that data. However, the report is only outputting information if there are ProgramRequirements already entered for a given ProgramArea. Is there a way to get it to output the ProgramArea and ProgramRequirement even if blank? Or am I going about th...

Does .Net XML Library support both SAX and DOM Model?
thx Baron wrote: The .NET framework XML classes provided by Microsoft do not support SAX, rather where SAX is push based parsing .NET provides a pull based parsing API with XmlReader (respectively XmlTextReader). DOM is supported the Microsoft and .NET way, System.Xml and its classes XmlNode, XmlAttribute, XmlDocument, XmlDocumentFragment, XmlEntity, XmlLinkedNode, XmlCharacterData, XmlDeclaration, XmlDocumentType, XmlElement, XmlEntityReference, XmlProcessingInstruction, XmlNotation can be seen as an implementation of the W3C DOM Level 2 Core but with lots of convenient extensio...

Adobe issues
We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are unable to send documents to PDF from GP - the PDF option remains grayed out. We have folowed the KB articles that are available, no success. Do we need to install Adobe 9.0 due to running Windows 7? Is GP 9.0 compatible with Adobe 9? Thank you for any assistance.. Hi Susan, I have a client using Adobe 9 on Windows 7. However, they are on GP 10.0 It is working succesfully. -- Geoff James "Susan" wrote: > We are running GP 9.0, using Windows 7, just installed Adobe 8.0 and are ...

Searching XML
I'm working with a substantial XML file. I need to locate a node with a particular value. I don't have much experience working with XML files. I found the XPath classes. Looks like I can use them to iterate through the nodes and find what I'm searching for. I was just wondering if there's any search function that I can use. Is this already supported? I'm having trouble finding this information because I'm not sure which class(es) I need. I don't want to use LINQ (if that's an option). Could someone point me in the right direction here? Thanks....

Issue with formula is Pivot table
I have the following formula in a pivot table: =IF(ISBLANK(Qtr[-1]),IF(ISNUMBER(Qtr[-2]),(Qtr[-2]*-0.08)+Qtr[-2], "),IF(ISBLANK(Qtr[-2]),0,Qtr[-1])) First to the issues that I am experiencing. First, the formula wa originally added as the one below but then updated to the formula abov to correctly reflect what I was trying to accomplish. =IF(ISBLANK(Qtr[-1]),IF(Qtr[-2]<>0,(Qtr[-2]*-0.08)+Qtr[-2], "),IF(ISBLANK(Qtr[-2]),0,Qtr[-1])) This issue is the original formula appears in the very first cell o the pivot table and then periodically through out the column. So, yo see ...

Hyperlink Issue #2
I have an issue with hyperlinks. When you click on the hyperlink on a webpage it returns an error stating that the the "item could not be created". Outlook 2000/Windows 2000 ...

Outlook Web Access OWA Issue - Login Prompt for Images
Dear Outlook 2003 / Exchange 2003 Users, Starting over the last two weeks (possibly after an update on the Exchange server), all of my users are starting to encounter the same issue when using Outlook Web Access (using IE6 on XP Pro systems). We have images in our signature block, and now when someone replies using Webmail to an e-mail originally sent via Outlook 2003, a login prompt appears for each image in the e-mail. Every time you cancel the login box, a red x image box appears, until all of the images that should be there are represented by the red x boxes. For the record, this has w...

Linq to xml not working
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Net; using System.IO; using System.Data; using System.Xml; using System.Xml.XPath; using System.Xml.Linq; using System.Diagnostics; namespace TelSearchModule { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { ///Start Test // Load XML doc XDocument rssFeed = XDocument.Load("http://tel.searc...

Change NameSpace Value on Selected Node
I have an XML document that is generated from Infopath, I need to change the value of a namespace that is defined in a node in the form: <xsf:xDocumentClass "xmlns:my=valuehere">. when i navigate to the namespace value it is read only and cannot be changed. Can anyone tell me how to change this value? My Code: Dim sSingleNode As XmlNode = objDoc.SelectSingleNode("//xsf:Node", NamespaceManager) Dim nav As XPathNavigator Dim docNav As XPathDocument docNav = New XPathDocument(sFile) nav = docNav.CreateNavigator nav.MoveToRoot() nav.MoveToFirstChild() nav.M...

Update Issues
Has anyone experienced any problems with XP Pro updates sent in Feb.? My Lenovo T61p has performed flawlessly for 2+years but suddenly started turning off and now stays on but freezes-up. I can’t detect a virus and seems like the Feb. updates are all that has changed. I plan to uninstall them….between freeze-ups, unless someone has a better thought. Thanks >Has anyone experienced any problems with XP Pro updates sent in Feb.? My >Lenovo T61p has performed flawlessly for 2+years but suddenly started turning >off and now stays on but freezes-up. I can�t detect a ...

~ issue
I am currently using Outlook Express 6 and have noticed that for the second time (did a format the first time thinking I had a virus!) that when I have downloaded the 330994 April 2003, Security update for Outlook Express 6 SP1 that anytime I make a change to my address book and reboot I get an icon on my desktop that is named "~" and it basically is my entire address book. Has anyone else experienced this problem and how do I remedy it? Thank you for any help! Sue In reviewing the Outlook Express newsgroups, this is reported as a known issue w/ no fix from Microsoft (report...

Multiple Outlook Mailboxes issues with 3.0
I have a large number of users who have more than one outlook mailboxes, When I open an email from one of the addtional mailboxes, I get an error message that tells me "Only Items in the default Outlook store can be promoted to Microsoft CRM." Does anyone know if this can be worked around?? ...

chkdsk issue
Whenever I run chkdsk /r, it finds quite a few errors and corrects them. An example is a lot of orphaned files. Then, if I run it again right away, it does the same thing and finds the sa,e orphaned files. What causes this and how can I correct it? Thank you. On 14 May 2010, five256@NOwhere.com wrote in microsoft.public.windows.vista.general: > Whenever I run chkdsk /r, it finds quite a few errors and corrects > them. An example is a lot of orphaned files. Then, if I run it > again right away, it does the same thing and finds the sa,e > orphaned files. What causes...

RSS Sync issue
Hi, I discovered that Outlook is not syncing all my RSS-Feeds. When i tried to export into an OPML list, the same issue which are not synced are not exported as well. Anyone idea ? Thanks Hans ...

Public Folder Replication issue #3
I have a single domain which is linked across a VPN to two sites. At both sites I have a DC and an Exchange box. The issue I am having is on Server A, I can see and access all public folders, on Server B I cannot see one folder and two other folders have no data. I have checked to ensure they are set up for replication and even in ESM it shows they are "In Sync" or "Local Modified". Any suggestions on how to resolve this would be greatly appreciated. Douglas Hiser In each public folder's properties do you have both servers showing as having replicas? Do yo...

Domain name issue migrating 5.5 to Exchange 2003
We are prepairing to migrate Echange 5.5 to Exchange 2003. This has come up as an issue: Our domain is cornerstone instead of cornerstone.com Our email address is "firstname.lastname@cornerstonegrp.com" instead of: "firstname.lastname@cornerstone.com" ...