xml-schema

XML Design and Name Reuse - Is it Good or Bad for Elements of Different Types to Have the Same Name?

When designing an XML structure I sometimes find myself wanting to use similar patterns across multiple element types that appear in the same instance document. For example, the Head-Body pattern can often be useful if you want to keep data and meta data (data about the data) separate, and sometimes it makes sense for multiple types of ...

parsing an xml schema to read/list all elements

So, I wish to parse an xml schema and list all the elements along with their annotation and type. I looked at some java possibilities - the closest was XSOM. It seems like driving a truck trailer to get some milk from the neighborhood store. I looked at JAXB, but there's no parse and list all elements against schemata. I don't want to ...

how namespaces can be read from xml file using xquery

I am reading XML files of Office 2007 document using xquery. In these files the namespaces are also included. I need to retrieve the node of namespaces. I wrote xquery to fetch data and it works fine if I removed namespace from the source XML file else of the xquery resultset is empty. Wanna know how can I read namespaces and value from ...

XSD Namespace backword compatibility

Hello All, We are struggling with some namespace compatibility issues. Currently we store some external data in our database as XML files with namespace as xmlns="http://xyz.com/prodresponse/v2", recently the vendor has changed the namesspace to xmlns="http://xyz.com/prodresponse/v4". The issue is we need to deal with both old and new ...

XML schema compatibility strategy

I work with an application that uses a large set of xml interfaces for integration and data import / export. We use JAXB to map from those interfaces to our domain object model. One challenge we frequently face is how to deal with the need to change to the these interfaces during the course of a project in the face of new requirements. ...

JAXB Java and XSD mapping

In one of my projects I use JAXB2 marshaller, having a contract-first web service I generate the objects from a XML Schema. Everything works just fine. But, I have a "code usability" issue. Let me give you an example. Schema: <xs:complexType name="personContractAlertListType"> <xs:sequence> <xs:element ref="PersonContrac...

XML validation with XSD: how to avoid caring about the sequence of the elements?

Hello everyone: I have following XSD code: <xsd:complexType name="questions"> <xsd:sequence> <xsd:element name="location" type="location"/> <xsd:element name="multipleChoiceInput" type="multipleChoiceInput" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="textInput" type="textInput" minOccurs="0" max...

Why doesn't JAXB want to validate

I wrote some Java classes and annotated them with the JAXB annotations. After that I used schemagen to generate an xsd. Then I build an object graph and marshalled it to a xml file. I modified the xml file so that it was not valid anymore. I wanted to use the xsd in the hope the JAXB unmarshalling fails. But it doesn't. Why? JAXB is ...

Looking for a smart command-line tool in Linux which can generate xsd out of xml.

I can also settle for a web-based interface, but a good command-line tool is preferable. Now, I have tried to use xsd.exe that comes with mono-devel, but that skipped a whole bunch of stuff that was mentioned in the xml file. I understand that I will need to hand-tweak the output, but I do want something decent to start with. ...

To send an object with its xml schema

All we are using web services. I want to send generic result from my function as a result. I can set its return type as an object type. I wonder that, can i create(generate) xml schema of my return type runtime? for ex: [Serializable] class NewClass{} [Serializable] class OldClass{} [WebMethod] public object fFunctionN...

Tool for creating a JAXB java class out of xml schema (reverse schemagen)?

How to create a JAXB java class out of a xml schema using a utility? I don't like reverse-engineering of several huge XSD-files to a JAXB-compliant java class. I know there's the jdk utility schemagen - but this works the other way round. What tool can help me? ...

StreamSource problem with FileInputStream vs File

SAX error if StreamSource(FileInputStream) but StreamSource(File) ok Hi, I encountered a StreamSource issue when the parameter was FileInputStream. When the parameter was File, it's ok. public int initXSD (String xsdFile) { // no error at all if File Source schemaFile = new StreamSource(new File(xsdFile)); // sax e...

WCF REST service's POST request's input XML not getting validated

Hi, I am trying to consume a RESTFul WCF service's Method through a POST request. Following is Webservice's method signature [DataContract(Namespace = "")] public class CompositeType { bool boolValue = true; string stringValue = "Hello "; [DataMember] public string StringValue { ...

how can we load a schema which imports other shemas with in it in a tree view control in c#?

how can we load a schema which imports other shemas with in it in a tree view control in c#? ...

Error while trying to validate XML in Java

I'm trying to validate one xml that I create with a local schema, but some freak error is throwing. My code: SAXParserFactory factory = SAXParserFactory.newInstance(); factory.setValidating(true); factory.setNamespaceAware(true); SchemaFactory schemaFactory = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); factory.setS...

Generate classes from XML Schema

Coming from a .NET background where you can easily generate an object model from an XML schema (through, for example xsd.exe) I wanted to know if there is a similar facility for generating Objective-C/NSObject objects. Thanks! ...

Load XML by SSIS - DTD is prohibited in this XML document error

Hi All, Hope you all are doing well. Previously I asked a question how to import a XML file to SQL Server thanks to all you responses. As my source file come with heavy amount of data, I am trying to load by SSIS. Below are the steps I followed: Imported XML by BulkLoad to a XML type column Created XSD Schema out of that XML file in...

Generating a XSD file from Powerdesigner

Is there a simple way to make Powerdesigner generate an XSD file? It generates an XSM file, but it's not the same specification. If there were a simple way of doing it, it would ease my life as heaven :P. ...

Extend complex types from an existing schema

I need to extend an existing XML document with new elements without losing the ability to validate it against both the unchanged original schema and an extended schema defined by me. For example, lets say I want to add Code and Price elements to an existing Book document, as follows: <aa:Book xmlns:aa="http://www.aa.com" xmlns...

Does VS2010 have an xml schema validator?

Hi I am wondering does VS 2010 have something that I can use to compare an xml document to my schema? I tried a few online tools but my xml document seems to big and my browser just crashes. Thanks ...