I am trying to create an element in an XML schema such that only standard (X)HTML elements can be used as children. What I've tried is this:
<xs:element name="description">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any namespace="http://www.w3.org/1999/xhtml" />
</xs:sequence>
</xs:co...
I'm running into real difficulties validating xml with xsd. I should prefix all of this and state up front, I'm new to xsd and validation, so I'm not sure if it's a code issue or an xml issue. I've been to xml api hell and back with the bajillion different options and think that I've found what would be the ideal strategy for validating ...
I'm receiving an xml message with unknown variable name elements... that is, they are not predefined...
I only know there can be 0 or more of those elements, allong with some other that are mandatory...
for example
<root>
<service>my service</service>
<resource>my resource</resource>
<action>update</action>
<parameters...
I have an XSD - it is designed to allow clients to my webservice to send XML data in a structured and robust way (that's the whole point of XSDs right?).
However I am designing some other part of the system and was going to use this XSD because it does 99.999999% of what I need it to do - it has all the data I could ever want - except i...
I need to compare two xml chunks:
They are semantically equivalent once we see that the "type" attribute is QName and not just a string. Is there a tool that can do such a comparison once I provide the schema? Also, is there such an api?
...
Hi everyone!
I have to parse a XML configuration file. I decided to do the basic validation with XMLSchema to avoid massive amounts of boilerplate code for validation. Since the parsing class should work for itself i was wondering: "How can i validate the incoming XML file with XMLSchema without having the XMLSchema stored on disc where...
Hi,
I have a question regarding adding restriction in my xml schema(xsd). I have a complex-type like:
<-->xsd:complexType name="xxx">
<-->xsd:attribute/>
.....
<-->/xsd:complexType>
I have many attributes in this complex-type, and few of them are of string type. Now I want those string type attributes to be restricted to y no. o...
I am trying to extend an XML schema to change the number of times a child can occur under an element.
In the original schema, the parent type is defined as such:
<xsd:complexType name="CrimeLineBusiness_Type">
<xsd:complexContent>
<xsd:extension base="PCLINEBUSINESS">
<xsd:sequence>
<xsd:element ref="CrimeSchedule" minOccurs=...
Hi,
I am creating attributes for a complex-type element. I created an attribute, which itself is of complex type. When I tried compiling my code, it threw an error saying could not find simple-type attribute corresponding to the attribute of complex-type. Can't we create attributes of complex-type?..I also looked at w3c schools, but it ...
Is it possible to create an XML schema with the following behavior? I have an XML file that looks like the following. I'd like to either expose or restrict attributes of Object based on the value of Type. For example, if Type="Bike" I might want to expose attributes related only to Bike (i.e. Pedals, Frame, etc). If the Type="Car", I mig...
What is the benefit of using attribute groups over attributes in defining an XSD Schema?
Ok... so I can declare them elsewhere and reference them...
What else?
...
How do I add a space in an XML schema element? I'd like to have "Last Name" without using an underscore. Thanks.
<xs:element name="Last Name" type="xs:string" minOccurs="0" />
...
Hi,
I have been having problem with adding type="date" in my schema, as whenever it is null it throws a marshalling error. I found out that for elements we can add an attribute like nullable="true" and get rid of this issue. But, wasn't able to find similar way for attributes. Is there a way to avoid this issue for attributes?
Thanks!...
I am using a xsd schema file; there I specified an ordered list.
When parsing an XML node of the kind...
<myOrderedList> "element_1" "element_2" "element_3" </myOrderedList>
(which is valid XML syntax)
...all XML parsers I know parse this as a single node element.
Is there a way to get the XML parser parse this list for me (return it ...
Hello,
I'm trying to query fields from the following XML query, (which is really a web service call):
<soap:Envelope xmlns:xsi="[schema]" xmlns:xsd="[shema]" xmlns:soap="[schema]">
<soap:Body>
<RunPackage xmlns="http://tempuri.org/">
<xmlDoc>
<Request>
<SubscriberCode>543253</SubscriberCode>
<...
Is there a standards-sanctioned XML format for describing entity queries?
Background: I plan to build a library for writing queries over WCF services.
On the client I want to be able to write (C#):
var customers = from c in service.Customers
where c.Name.StartsWith("P")
order by c.Name
...
I have an xml with an xml-schema. The xml-schema defines an abstract complex type with 2 optional attributes that have default values. Then I have several complex types that extend the base one. And finally nodes of the types defined.
So I load the xml and when I parse each node, the optional attributes are not present at all.
I've tried...
We have a lot of serialization done through MS XML 4. When we serialize C++ enums we use a table to translate each possible value to a string and them store that string as an attribute value. When we deserialize we read that attribute value, compare it against all items in the table and retrieve the corresponding enum value. If we fail t...
Example Schema:
<complexType name="Dog">...</complexType>
<complexType name="Cat">...</complexType>
<complexType name="ArrayOfDog">
<sequence>
<element name="Dog" type="tns:Dog minOccurs="0" maxOccurs="unbounded" />
</sequence>
</complexType>
<complexType name="Foo">
<sequence>
<element name="Bar" type="str...
Howdy,
I need to validate a XML file against a schema. The XML file is being generated in code and before I save it I need to validate it to be correct.
I have stripped the problem down to its barest elements but am having an issue.
XML:
<?xml version="1.0" encoding="utf-16"?>
<MRIDSupportingData xmlns="urn:GenericLabData">
...