xml-schema

How does one get the system time in XML? Is there a method/function?

I am using an XML file to store data and parameters which is to be used by a parser, however in that XML I also have to use system time. So, is there any built-in functionality in XML to get system time, perhaps something similar to getTime() in Javascript? ...

Where should I resctric the ocurrences of a type in an XML Schema, element or sequence

Is there any difference between limiting the occurrences of an element in the element tag or the sequence tag, what would be the best place to do it? Or it's just a matter of style? Example: <xs:element name="Provider"> <xs:complexType> <xs:sequence minOcurrs="1" maxOccurs="unbounded"> <xs:element ref="Distribui...

Failure validating Xml: The namespace 'X' provided differs from the schema's targetNamespace 'Y'.

I'm getting the following error while validating an xml document while using IXMLDOMDocument2 (C++): The namespace 'http://www.somesite.com/schema/2.0' provided differs from the schema's targetNamespace 'http://www.somesite.com/schema/2.0/SomeObject' . The Xml I'm trying to validate is: <id:envelope xmlns:id="http://www.somesite.c...

Correct way to use key in xsd

I'm writing an XSD schema for a project I'm working on. The schema below is one I took from a microsoft example and modified slightly. I am trying to use the key and keyref to declare a unique key for one set of items and then refer to that key in another section. I couldn't get it to work for a long time. I would write the schema and ...

XML Schema: Constraining Number of Occurrences to be Consistent

Say that element B is a child of element A. Is there a way to make sure that for each A, the number of B elements is unbounded as long as it is consistent across A elements? For example, the following would validate: <A> <B/> <B/> </A> <A> <B/> <B/> </A> Because both the first and last ...

XML Schema - Key in sequence

I'm trying to put a key in sequence and am being bombarded with errors. It seems I can't do this. Additionally, I am being told my key needs a field and selector, which I have been able to find very little documentation on. (In fact, in desperation, I downloaded Liquid XML Studio [vs. Notepad] and searched it's help files. . . to find NO...

How to fail schema validation if the value in one node is greater that the value in another?

I all, given the following piece of xml, what would the xsd look like that would ensure chema validation failed if MortgageProductInterestRateCollarLimitPct was greater than MortgageProductInterestRateCappedLimitPct? <MortgageInterestRate> <MortgageInterestRatePercentage>1.99</MortgageInterestRatePercentage> <MortgageInterestRatePe...

hi all, i am writing an xml to store data, can anyone tell about default type of attribute?

<xs:element name ="ID"> <xs:complexType> <xs:simpleContent> <xs:attribute name="OFFSET" type="U8" fixed="00"/> </xs:complexType> </xs:simpleContent> However i want to make OFFSET greater than 1024 .in that case i get error 1024 invalid value for atomiv'U8' i tried defining OFFSET in following manner <x...

.NET 3.5 - Relax the strictness on Xml returned from a Web Service

I'm calling a SOAP 1.1 web service that I don't own and it's not strict about returning valid Xml. Specifically, when sending SOAP faults it's ignoring the order of sub-elements that are specified in the for the SOAP schema. The result is that when I call the service and it returns a SOAP fault I end up with a CommunicationException a...

bnf/ebnf for xml schema

I'm looking for a BNF/EBNF of XML Schema. I just found the one for XML (http://www.w3.org/TR/REC-xml or extracted at http://www.jelks.nu/XML/xmlebnf.html). Well it's a starting point, but I'm curious that I couldn't find a more specific one for XML Schema. ...

Sitemap for dynamic PHP website ... the "lastmod" field is needed?

Hello, I've a really small website, so I usually update the sitemap by hand! In each "url" element there are the fields: loc, lastmod, changefreq and priority. The "lastmod" field is setup to the date in witch I update the content of the related PHP page or the content that is loaded dynamically in the related PHP page! I've tried to...

"extend" an xml schema

I'm trying to "extend" an xml schema (nhibernate here, for example), to add my own entities inside of it. I'm stuck to the point where validation chokes on the "exm:foo" (and exm:foobar) entity, as the "base" schema doesn't allow it. How can I manage to do that, without changing the base schema ? Sample : <?xml version="1.0" encoding="...

Sending and receiving XML Data

Hello, I am a .NET begginer and i'm trying to develop a webservices using C# so i can send a XML data to an specific URL. I can't use Web Reference and i need to construct the xml data using this kind of format: <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"&gt; <so...

How to validate an XML file with a schema in memory with .NET?

Is it possible to validate an XML file using an XSD loaded at runtime from embedded application resources instead of using a physical file, with .NET (Framework 3.5)? Thanks in advance ...

Creating an XML Schema with attributes and elements contingent on other attributes

I'm trying to develop a schema that will validate some existing XML files I've inherited. I'd like to have the schema do as much of the validation work as possible. The challenge is that attributes and elements are contingent on the values of other attributes. The real data is pretty abstract, so I've created some simple examples. Let's...

Set attributes on child xml nodes if valid according to schema

I've got an XmlDocument and a schema (xsd) file. I'd like to set the "foo" attribute to a value of "bar" for every element in the xml for which "foo" is a valid attribute according to the schema. Is there an easy way to do this? ...

Examples of XMLSchemas with variable content models

I have been involved in developing XMLSchema models for a community domain (science) and find the variable content models very complicated and probably too complex for my community. I'd be very interested in successful public deployment of XML Schemas with variable content models (E.g. "salami slice", "venetian blind", "russian doll", "h...

Are there any standards for structured email templates?

On a number of occasions I've found myself needing a way of representing an email message in a structured textual form inside my application (java applications, but that's not really relevant). Previously, I've used a hand-rolled XML format along the lines of: <email> <from>[email protected]</from> <to>[email protected]</to> ...

Liquibase noob strikes again - Error on sqlFile tag.

Hi, Im using the sqlFile to include an sql script that creates tables using oracle specific commands (NOCACHE, NO PARALLEL, stuff like that). My master.xml file includes all sql scripts and executes them. However, when it detects a tag, it fails and prints this error message. C:\update.bat master.xml Migration Failed: cvc-complex-type....

Can't read xml through XPathNavigator

Here is my code, I don't know why I can't read the data through XPathNavigator. But it was well before I add namespace and schema. XmlReaderSettings settings = new XmlReaderSettings(); settings.Schemas.Add("http://www.somewhere.com", schemaPath); settings.ValidationType = ValidationType.Schema; XmlRe...