xml-schema

XML validation by XSLT or Schematron in Eclipse XML Editor?

How can we validate xml document by either schematron or xslt in Eclipse xml editor? The idea is to extend xml document live validation in eclipse xml editor with some rules based validation method. ...

Don't understand this piece of XML

I'm trying to make an XML schema, and not having too much success. there's a construct I don't understand ... here's what I have so far for the schema, followed by the XML file I'm trying to make it for .. any suggestions? <?xml version="1.0" encoding="utf-16"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; <xsd:...

Add an array to an XSD file to assign users to a permissions specification

I am not a programmer, so this may or may not make sense, but I would like to be able to link an external data file to an XSD file to specify whether a user belongs to a certain group. Without linking, the code currently stands as: <xs:element name="user"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumer...

Schema for open-ended XML

I am implementing a RESTful web service that currently handles JSON and needs to handle XML. I use Jackson to automatically marshall Java objects to and from JSON. For XML I need to define a Schema, mainly because a customer wants it. With luck, I can hand the Schema to JAXB and not have to code the XML marshalling myself. One featur...

Restrict the depth of nested elements in XSD

Is it possible with XML schema to restrict the depth of child elements nested in a parent? The context here is I collect alarms from a management system and I want to provide a XML document which allows the end user define some rules in order to filter the alarms into folders in the UI. I want to restrict the depth of nested folders to ...

Solr: QueryElevationComponent requires StrField uniqueKeyField error.

Hi, I recently installed solr. The example index (found at apache-solr-#.#.#\example\solr) seems to work, and, once copied to my solr home directory, I am able to access it through the admin pages. However when I try to implement a new index by replacing the schema.xml content with (taken from here): <?xml version="1.0" encoding="UTF-8"...

Solve: XML Schema validation ignored when fragment-level conformance is enabled?

From my sojourn with XML and Schema validation, it seems that when fragment-level conformance is enabled for an XMLReader instance, the XML source stops being validated against any included Schemas. However I cannot verify this from the MSDN documentation as it doesn't seem to describe XSD Schema behaviour in light of conformance level...

What is allowed in Restricted XPaths (constraints)?

I need to apply constraints in a large XML file, like this: <library> <book> <bookAuthor ID="1" nameAlias="PeerBR jr"/> </book> <book> <bookAuthor ID="1"/> </book> </library> <authorCatalogue> <author ID="1" name="PeerBr"/> </authorCatalogue> I need each bookAuthor's ID to refer to a valid author. ...

XSD Formatting <element><complexType> vs <complexType/><element/>

This XSD portion was obtained from: http://www.iana.org/assignments/xml-registry/schema/netconf.xsd <xs:complexType name="rpcType"> <xs:sequence> <xs:element ref="rpcOperation"/> </xs:sequence> <xs:attribute name="message-id" type="messageIdType" use="required"/> <xs:anyAttribute processContents="lax"/> </xs:complexTy...

iBatis schemas not working in Visual Studio 2010

iBatis comes with three schema files that provide intellisense to VS.Net. According to the iBatis help docs, the location should be this: C:\Program Files\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml or this if you have x64 installed: C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\Packages\schemas\xml The...

How to correct a xml file based on a xml schema?

There are a lot of files that have changed unintentionally and now they don't match their related schema. What I want to do is to find the errors and to correct them automatically (if possible). I looked at the validation mechanism available in .NET framework. The problem is I don't know how I can edit the erroneous node.The validation ...

zpt xml-schema definition

Where can i find xml-schema definition for ZPT attribute language? ...

Is it better to have information about an XML node as an attribute or a child node?

I prefer to have my XML documents structured in the following way: <root> <node info1="blah" info2="blah" /> <node info1="blah" info2="blah" /> </root> Instead of: <root> <node> <info1>blah</info1> <info2>blah</info2> <node> <node> <info1>blah</info1> <info2>blah</info2> <node> </root> I th...

XMLSpy ignores "minOccurs"? Why is this XML valid?

Please enlighten me why XML Spy thinks this is valid. FYI, this specifies an SQL query. Here the XML: <sideBar title="LabelSearch"> <searchLabel table="ID=*.companies"> <filter accessRight="r"> <and> <filterElement argument="companies.Type" operator="=" value="Client"/> </and> </filter> </searchLabel> </sideBar>...

referential integrity in XML files without globally unique IDs

Maybe I'm not seeing the forest for the trees, but here it goes: I'm "designing" an XML document and have so far come up with something like the following: <element key="root"> <data>...</data> <elements> <element key="foo"> <data>...</data> </element> <element key="bar"> <data>.....

How to best capture this XML Schema in C# classes

I have a large XML schema that has elements that look like this: <xs:element name="Tmats"> <xs:complexType> <xs:sequence> <xs:element name="ProgramName" type="xs:string" minOccurs="0"> <xs:annotation> <xs:documentation>PN</xs:documentation> </xs:annotation> ...

XML sequence with arbitrary number of comments

Alright, so I'm using XML schema to validate a following type of xml file: (just pretend the parens are actually angled brackets). <root> <A> <B></B> <C></C> </A> </root> pretty simple -> except the catch is that I also want to have a comment element, which can occur an unbounded number of times in any order (provid...

Query XML Type Column in SQL Server 2008

Hi I have created a table that has a strongly type XML column in SQL2008 database. I'm having trouble understanding the documentation or samples that show how I can do a simple query to select the rows that have a value of true for a particular element. The closest I can get without having errors thrown is: SELECT Person.* FROM [Profi...

C# .NET Serialization - how to include schema in output

I've produced a class using the XSD.EXE for an XML web service. My question is how do I include the schema? Current XML output: <?xml version="1.0" encoding="utf-8"?> <dsXmlSummary xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.tempuri.org/dsXmlSummary.xsd"&gt; <ad...

paint a property pane from xml schema

We need to build a swing component to let users enter property values in a property sheet. These properties are defined in a XSD file. For example: <xs:complexType name="email"> <xs:sequence> <xs:element minOccurs="0" name="body" type="xs:string" /> <xs:element minOccurs="0" name="from" type="tns:person" /> <xs:element min...