Difficulty seeing error

If I try to validate this xml...
<?xml version="1.0" encoding="utf-8" ?>
        <a:FuncalcParameters xmlns:a="http://www.somewhere.fun.com/Funcalc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.somewhere.fun.com/Funcalc
http://localhost/FuncalcService/FuncalcParameters.xsd">
          <TransId>D-288</TransId>
          <CalcType>CalculateARM</CalcType>
          <SR>5</SR>
          <RRT></RRT>
          <RRQ></RRQ>
          <B_Indicator>y</B_Indicator>
          <ReferenceYYYYMMDD>1998-05-12</ReferenceYYYYMMDD>
          <ARM>lala</ARM>
          <SRMP>136.26</SRMP>
          <ResponseYYYYMMDD>2003-06-30</ResponseYYYYMMDD>
        </a:FuncalcParameters>
....against this schema...
<?xml version="1.0" encoding="utf-8" ?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.somewhere.fun.com/Funcalc"
targetNamespace="http://www.somewhere.fun.com/Funcalc">
 <xs:element name="FuncalcParameters" nillable="true"
type="FuncalcParameters" />
 <xs:complexType name="FuncalcParameters">
  <xs:sequence>
   <xs:element minOccurs="0" maxOccurs="1" name="TransId" type="xs:string"/>
   <xs:element minOccurs="1" maxOccurs="1" name="CalcType"
type="CalculationType"/>
   <xs:element minOccurs="1" maxOccurs="1" name="SR" type="xs:string" />
   <xs:element minOccurs="0" maxOccurs="1" name="RRT" type="xs:string" />
   <xs:element minOccurs="0" maxOccurs="1" name="RRQ" type="xs:string" />
   <xs:element minOccurs="0" maxOccurs="1" name="B_Indicator"
type="BackType" />
   <xs:element minOccurs="0" maxOccurs="1" name="ReferenceYYYYMMDD"
type="xs:date" />
   <xs:element minOccurs="1" maxOccurs="1" name="ARM" type="xs:float" />
   <xs:element minOccurs="1" maxOccurs="1" name="SRMP" type="xs:float" />
   <xs:element minOccurs="0" maxOccurs="1" name="ResponseYYYYMMDD"
type="xs:date" />
  </xs:sequence>
 </xs:complexType>
 <xs:simpleType name="CalculationType">
  <xs:restriction base="xs:string">
   <xs:enumeration value="CalculateARM" />
   <xs:enumeration value="CalculateSRMP" />
  </xs:restriction>
 </xs:simpleType>
 <xs:simpleType name="BackType">
  <xs:restriction base="xs:string">
   <xs:enumeration value="b" />
   <xs:enumeration value="B" />
  </xs:restriction>
 </xs:simpleType>
</xs:schema>
....the validation complains that...
Element 'http://www.somewhere.fun.com/Funcalc:FuncalcParameters' has invalid
child element 'TransId'. Expected
'http://www.somewhere.fun.com/Funcalc:TransId
http://www.somewhere.fun.com/Funcalc:CalcType'...
Why does it mention "CalcType"?  Altering the schema so that "CalcType" is
further down results in the validation complaining about
'http://www.somewhere.fun.com/Funcalc:TransId
http://www.somewhere.fun.com/Funcalc:SR'.  Can anyone see what's going on?
Thanks



0
mcdonama (6)
9/8/2003 6:22:24 PM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
506 Views

Similar Articles

[PageSpeed] 16

I think I found my error. By simply adding the namespace "a:" to all of the
instance doc's elements, everything behaves as I would expect.  It was not
just a "TransId" or "CalcType" problem - in fact all of the elements needed
to be qualified in the "a:" namespace.  But still I wonder why if all of the
elements needed "a:", why did the error message only complain about the
first two?  Oh well...

"Marty McDonald" <mcdonama@wsdot.wa.gov> wrote in message
news:#CshoYjdDHA.2436@TK2MSFTNGP09.phx.gbl...
> If I try to validate this xml...
> <?xml version="1.0" encoding="utf-8" ?>
>         <a:FuncalcParameters
xmlns:a="http://www.somewhere.fun.com/Funcalc"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.somewhere.fun.com/Funcalc
> http://localhost/FuncalcService/FuncalcParameters.xsd">
>           <TransId>D-288</TransId>
>           <CalcType>CalculateARM</CalcType>
>           <SR>5</SR>
>           <RRT></RRT>
>           <RRQ></RRQ>
>           <B_Indicator>y</B_Indicator>
>           <ReferenceYYYYMMDD>1998-05-12</ReferenceYYYYMMDD>
>           <ARM>lala</ARM>
>           <SRMP>136.26</SRMP>
>           <ResponseYYYYMMDD>2003-06-30</ResponseYYYYMMDD>
>         </a:FuncalcParameters>
> ...against this schema...
> <?xml version="1.0" encoding="utf-8" ?>
> <xs:schema elementFormDefault="qualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://www.somewhere.fun.com/Funcalc"
> targetNamespace="http://www.somewhere.fun.com/Funcalc">
>  <xs:element name="FuncalcParameters" nillable="true"
> type="FuncalcParameters" />
>  <xs:complexType name="FuncalcParameters">
>   <xs:sequence>
>    <xs:element minOccurs="0" maxOccurs="1" name="TransId"
type="xs:string"/>
>    <xs:element minOccurs="1" maxOccurs="1" name="CalcType"
> type="CalculationType"/>
>    <xs:element minOccurs="1" maxOccurs="1" name="SR" type="xs:string" />
>    <xs:element minOccurs="0" maxOccurs="1" name="RRT" type="xs:string" />
>    <xs:element minOccurs="0" maxOccurs="1" name="RRQ" type="xs:string" />
>    <xs:element minOccurs="0" maxOccurs="1" name="B_Indicator"
> type="BackType" />
>    <xs:element minOccurs="0" maxOccurs="1" name="ReferenceYYYYMMDD"
> type="xs:date" />
>    <xs:element minOccurs="1" maxOccurs="1" name="ARM" type="xs:float" />
>    <xs:element minOccurs="1" maxOccurs="1" name="SRMP" type="xs:float" />
>    <xs:element minOccurs="0" maxOccurs="1" name="ResponseYYYYMMDD"
> type="xs:date" />
>   </xs:sequence>
>  </xs:complexType>
>  <xs:simpleType name="CalculationType">
>   <xs:restriction base="xs:string">
>    <xs:enumeration value="CalculateARM" />
>    <xs:enumeration value="CalculateSRMP" />
>   </xs:restriction>
>  </xs:simpleType>
>  <xs:simpleType name="BackType">
>   <xs:restriction base="xs:string">
>    <xs:enumeration value="b" />
>    <xs:enumeration value="B" />
>   </xs:restriction>
>  </xs:simpleType>
> </xs:schema>
> ...the validation complains that...
> Element 'http://www.somewhere.fun.com/Funcalc:FuncalcParameters' has
invalid
> child element 'TransId'. Expected
> 'http://www.somewhere.fun.com/Funcalc:TransId
> http://www.somewhere.fun.com/Funcalc:CalcType'...
> Why does it mention "CalcType"?  Altering the schema so that "CalcType" is
> further down results in the validation complaining about
> 'http://www.somewhere.fun.com/Funcalc:TransId
> http://www.somewhere.fun.com/Funcalc:SR'.  Can anyone see what's going on?
> Thanks
>
>
>


0
mcdonama (6)
9/8/2003 7:43:11 PM
Hi Marty,

While I can't answer your question myself, I have sent it on to the team 
that supports XML in developer Support.  I'll get an answer to you ASAP.

Brett Keown
Microsoft Support
brettke@online.microsoft.com

This posting is provided "AS IS" with no warranties, and confers no rights. 

0
brettke (9)
9/9/2003 7:21:04 PM
Here is what I see.

1> Xsd seems simple enough.  You have an element called "FuncalcParameters" 
which has 10 child nodes (some of which may be present and others are 
required).
2> Required items are CalcType, SR, ARM and SRMP.
3> All can only occur once in sequence.

From the Xml, I see the following.

1> We are associating the prefix "a" with 
"http://www.somewhere.fun.com/Funcalc"
2> FuncalcParameters is associated to the prefix (and therefore namespace) 
"a"
3> Funcalc does not have ANY children to validate against and should fail 
on the "CalcType".
4> Because the first child HAS to be TransID, it should also fail because 
there is no a:TransID. (remember that TransID and a:TransID are totally 
different.)
	TransID internally is TransID
                a:TransID internally is 
TransID:http://www.somewhere.fun.com/Funcalc


So, there are a few ways to workaround this.

1> Remove the "a" from the xmlns:a="http://www.somewhere.fun.com/Funcalc".  
If you choose to leave the prefix "a", then you will have to prefix ALL 
elements belonging to that namespace with "a".  Also, remember, when you 
place a sequence into the element, you are basically saying that the 
elements will be in that order and any other order is incorrect.
2> Prefix all elements with "a" and associate it with the namespace.

It would always be best to do #2, however, many use #1 for ease.

Let us know if you need additional clarification.

Thanks

Bruce Taimana

Microsoft Developer Support XML WebData Group

Are you secure? For information about the Microsoft Strategic Technology 
Protection Program and to order your FREE Security Tool Kit, please visit 
http://www.microsoft.com/security.

This posting is provided "AS IS" with no warranties, and confers no rights. 
You assume all risk for your use. 

� 2001 Microsoft Corporation. All rights reserved.


0
bruceta (2)
9/10/2003 4:54:38 PM
Reply:

Similar Artilces:

writer error
Hello, I declare it in a public function inside a class: XmlTextWriter xml_writer=null; xml_writer=new XmlTextWriter(); and get this error: System.Xml.Writer.XmlTextWriter()' is inaccessible due to its protection level Could someone tell me why (in c#) it happens? Thanks a lot! *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! juli jul wrote: > I declare it in a public function inside a class: > XmlTextWriter xml_writer=null; > xml_writer=new XmlTextWriter(); > > and get this error: > > Sy...

Failed to grant minimum permission requests - ASP.NET
I ran into this error over and over trying to install Dynamics GP Business Portal to a MOSS 2007. It seemed to me tha t ASP.NET doesn't have enough permission to execute certain commands, such as creating a new site from the installation program. The installation eventually went thru but the BP site never got created, so I have to unstall BP gain! Any help is greatly appreciated Bill ---------------------- Event Type: Warning Event Source: ASP.NET 2.0.50727.0 Event Category: Web Event Event ID: 1310 Date: 10/5/2008 Time: 12:04:54 PM User: N/A Computer: WEBPORTAL Description: Eve...

HELP dogs & cats in China please! [MUST SEE]
mms://a805.v9135e.c9135.g.vm.akamaistream.net/7/805/9135/0029/peta.download.akamai.com/9135/downloads/jcruel_china_dog_med.wmv ...

Error when adding a new task
Hi If I try to add a new task in my outlook i receive the following error on a popup: -- Could not complete the operation. One or more parameter values are not valid. -- I have tried to reset my default task view. Recently I had a new machine, but the error prevails. I am connecting to a Exchange server at work. Any hints warmly welcomed, regards, AVO Long shot change the view on the Task Folder to Simple list and then from the Actions menu select "Save Task Order". "�g�st" <agustvo@ru.is> wrote in message news:082f01c3d9af$f117f850$a401280a@phx.gbl... > ...

Flip Difficulty
I am running Visio 2003 SP1. I have drawn a home floor plan. I select the entire floorplan, and try to "flip" it (for example, I want the garage on the right instead of the left, so I mirror, or flip, the entire plan). I get an error message and then the drawing is mis-configured with lines going in odd directions, like it flipped some objects but not others. Here are two of the error messages 01. "An error (318) occurred during the action Flip Horizontal. Referenced cell Wall.629!Connections.X4 does not exist". 02. "An error (318) occurred during the action F...

error message #76
I keep receiving an error message when I try to open a JPG file in Outlook 2000 that says "The system cannot find the path specified." These files used to open in Netscape but I got rid of Netscape to use Internet Explorer but now I can't just double click on it to open it. Any suggestions where I need to change a setting to make it work? Thanks Tracy <anonymous@discussions.microsoft.com> wrote: > I keep receiving an error message when I try to open a JPG > file in Outlook 2000 that says "The system cannot find the > path specified." These files...

Error when closing Process Server
I am getting an error when closing the Process Server. The error title bar: DDE Server Window: Dynamics.exe - Application Error Error Message: The exception unknown software exception (0xc00200001) occurred in the application at location 0x77e4bee7. Click on OK to terminate the program Has anyone seen this error before, or know how to correct? Windows 2003 Server, GP10 sp2... ...

Cannot see all characters in cell
I have workbook that contains column for text/comments. I am unable to see all of the text in the cell no matter how I size it. All the text is displayed in the formula bar when the cell is selected, however not all of the text is displayed in the cell itself I have Excel 97 and I believe there is a 256 character limit. Is there a way to get around this limit, or can I do something to enable all text to be seen Thanks EU I am having the same problem on a form that I use every month. At the top there are 4 words that show up in the formula box, but don't show up in the cell or when I p...

Dynamic Chart Scaling Error
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I have finally figured out how to dynamically scale a chart that links to a table that can change by have the trailing cells empty. <br><br>The Table has two rows and 16 columns C6:R6 are dates and C7:R7 are numbers. When any of the cells at the end of the table are blank such as Q6 and R6 being blank I want the chart to only plot 14 data points. I should add C6:R7 are all formulas that reference another place in the work book. <br><br>That I did is define names Where the name &quot;NBCL&a...

Cannot see shading in cells
I have tried applying several different shading colors to a column of cells in an excel 2003 spreadsheet. According to the Patterns tabs of the "Format Cells" dialog the last color tried has been applied, I just cannot see it (or any of the previous colors) on my spreadsheet (in normal view, split panes, screen resolotion @ 32 bit, standard .xls file format). Any ideas for me to try? Thanks, Norm Changes to the fill color and the fill pattern are not displayed in Office programs http://support.microsoft.com/default.aspx?scid=kb;en-ca;Q320531 -- Regards Ken....

msde error
Hi, I install msde 2000 using the command line like this => setup SAPWD="pass" But when I try to create a new database using access sql server database wizard he ask me for a login id and password! First if my password is pass what is the login id? When I try the login id of my computer user name or sa and the password as pass I always get an error message: Connection failed: SQLSTate:28000 SQLserver error:18452 Why??? Did my msde installation is good I set the server name and the msde icon in the try icons is on and running! Thanks! ...

Can't see macro
I am experimenting with a macro from David McRitchie's page: I create a custom button, and when I try to assign the macro, it is not in my options. It is in the workbook. What am I doing wrong? All the other macros are there. Joe Sub Insert_Rows_And_Fill_Formulas(Optional vRows As Long) ' Documented: http://www.mvps.org/dmcritchie/excel/insrtrow.htm ' Re: Insert Rows -- 1997/09/24 Mark Hill <markhill@charm.net.noSpam> 'Dim vRows As Integer ' row selection based on active cell -- rev. 2000-09-02 David McRitchie ActiveCell.EntireRow.Select 'So you do n...

OLE Registration Error #2
Working on a Win 98 Second Ed. box running Office 2000 Premium. When upgrading to IE6 SP1, I started having trouble with the Internet Explorer. So I rolled back to a previous version, which in turn caused the 'OLE Registration Error' in Outlook 2000. Re-Installed IE6 SP1, with no change... any suggestions? ...

Error when Installing OL2003
I am getting following error when installing a new instance of OL2003Pro an unhandled win32 exception occurred in outlook.exe All other Office products run fine. Using XP Pro SP2 attached to exchange 2003 Need answer or solution steps ASAP. Thanks. As an update, I intsalled the reuired MS Updates but now getting an error message saying something cannot be "read". I had the 2007 Beta installed and unintsalled that. Could this be the problem?? "JC HARRIS" <harris1113@fake.com> wrote in message news:OUJcACSzGHA.996@TK2MSFTNGP03.phx.gbl... >I am getting f...

Unexpected error
Hi all, I am getting the following error when I open the Microsoft application "An unexpected error occurred while trying to load the Microsoft Framework Libray" Can anyone shed some light on a new Mac user please!! Framework errors are usually an indication of a missing or inneffectively applied update. Since you don't mention version I can't be sure which you need, but if Office X update to 10.1.8, if 2004 then 11.3.3 followed by 11.3.4 - even if you've recently applied them. You may also need to reapply the current OS X updater (10.4.8). Run Disk Utilit...

Installing V3C Outlook client error
I am trying to install the V3c Outlook Client(Laptop -Offline) on XP Pro with latest SP, Office 2003 Outlook. It installs SQL Server 2005 Express OK, however I receive the following errors in the validation stage: 1. Microsoft SQL Server 2005 Express Edition database ( Red (X)) 2. The 'SQLOLEDB' provider is not registered on local mackine.Noerror information available: REGDB_ECLASSNOTREG(0x8004054) (Red (X)) Can anyone point me in the right direction TIA Hello Graham, I think for some reason the registration of a DLL file is not ok anymore or corrupted. Usually the tool...

Encountering Error: This is an unexpected token. The expected token is 'NAME'.
I have a class that defines a Key/Name value collection that i generated by and XML Element with multiple attributes. The attribute are used to create the collection of 'Binate' objects. This is writte in VB.NET 1.1. I have this class in a Win32 test application and it works fine. Whe I put the class in a Web app I get the following error. The assembl it is in is not directory in the ASP.NET application but in one tha the ASP.NET application references. Here is an example of the code that accepts an XML Text Stream t create the collection of Binate objects. Public Sub New(ByVal...

How to hide the macro code that no one can open & see the code?
Hi, In Microsoft Excel, I am using a Visual Basic for Applications macro t run an application. I wanted to hide this macro/ code from other users except me. Should we use password in order to open the code or is there somethin available in EXCEL via which can hide the code? How should we hide the macro so know one can open and see the code? Thanks Jumm -- Message posted from http://www.ExcelForum.com Hi You can protect your VBAProject with password (right-click on VBAProject in Project window, open properties, and set password on Protection tab) - then without password the user don'...

Quick print - error
I understand that the settings are stored in Dex.INI. All users have read/write access to this file - however we can only use Quick Print if the Adminstrator is logged into Windows. It must be a security issue however don't know where else to look. Any clues anyone? C Catherine, Can you give full access to the Great Plains directory to your users. Gerald "Catherine the Brit" wrote: > I understand that the settings are stored in Dex.INI. All users have > read/write access to this file - however we can only use Quick Print if the > Adminstrator is logged into...

.PST Difficulty
If you could follow the dialogue and help me out in anyway....I am a littl concerned as this is my only copy... Dialogue: Question I am getting this error when I attempt to copy the .pst file I have burned to a cd rom to my locasl hard disk: Cannot Copy Sept22: Invalid MS DOS Function I am a little concerned since since the machine I have taken this information from and burned to cd is no lonbger available...Any ideas? Response: How are you trying to copy the file? My Response I am just selecting it from the cd rom..and dragging it to a folder...As well I have tried Copy and Past...

Inventory Errors in ver. 2002
I did not buy the 2003 release of Money Delux and Business because after extensive questioning of MS I was told that none of the Inventory problems that existed in 2002 were addressed in 2003. Has version 2004 fixed problems? Many with reporting? Is there more flexibility with reporting? Are part numbers now a feature? Download the 2004 trial. If you don't find any improvement you can uninstall 2004 and go back to the backup file that 2004 made when it converted your 2002 file. -- Regards Bob Peel, Microsoft MVP - Money Hints/Tips http://support.microsoft.com/default.as...

Difficulty importing library with VC++
Hello, I am having a small difficult using the SetupAPI library. I made the call: SetupDiDestroyDeviceInfoList and when I build my code, it tells me that it is unable to resolve the reference to __imp__SetupDiDestroyDeviceInfoList. I went to MSDN and I found that this is located in SetupAPI.lib. In Visual Studio C++ .net, I went into the Project Properties and under linker->Generl->Additional_Library_Directories, I added the path that will point to SetupAPI.lib which has the function defined in it. It still doesn't work. Then I thought that maybe MSDN lied to me, so I disected t...

Why can't I see the pictures that I am inserting in my Pub. 2002 d
I am having a problem that I have not encountered before in previous pub. 2002 documents - I am insterting pictures and can see that they are insterting and yet can't see the picture. it's not a problem of having the picture inserted into the back ground. View, pictures, detailed display. Is it just this one document? If not, slide the acceleration down on your video adapter, control panel, display folder, settings tab, advanced button, troubleshoot tab. If this solves the issue, go to the manufacturer's web site and look around for an upgraded video driver. -- Mary Sauer...

Error Messages in Outlook XP
To All, I have installed then reinstalled Office XP two times. I get an error message when I do a send/receeive in Outlook. The error message is as follows: "Operation failed. Could not find object." What am I missing? Any help with this matter would be greatly appreciated. Thanks, Kevin ...

error message 06-19-04
Can anybody tell me why this message appear when I try to click command button on a start form and how to make it disappear? AIRPEX is the name of the startup form. "The expression On Click you entered as the event property setting produced the following error:A problem occured while AIRPEX was communicating with OLE server or ActiveX Control. *The expression may not result in the name of a macro,the name of a user-defined function,or [Event Procedure]. *There may have been an error evaluating the function,event or macro." Any help will be appreciated. http://support.microso...