xsd

How to use schema component designators in xerces for java?

最后都变了- 提交于 2020-01-17 07:52:19
问题 I want to run SCD queries on a schema. The docs indicates that there is experimental support, but I don't see anything in the javadoc. Anyone know how it's supposed to work? 回答1: Checkout this wrapper on xerces. It can locate the paths as well as generate them. 来源: https://stackoverflow.com/questions/8581594/how-to-use-schema-component-designators-in-xerces-for-java

XML Schema for Tagged Union

荒凉一梦 提交于 2020-01-17 06:54:10
问题 I have an XML doc that includes a repeating series of addresses whose actual content depends on the value of an included enumeration. I suppose this is a type of "tagged union" [or "discriminated union"?]: { <AddressList> <Address> <AddressType type="addressEnum" fixed="CanadianAddress"/> <AddressValue> <Street type="textstring">123 Yonge Street</Street> <Province type="provinceEnum" value="Ontario"/> <PostalCode type="postalCodeType" value="M1N 2O3"/> </AddressValue> </Address> <Address>

XSD from variable number of XML elements

风流意气都作罢 提交于 2020-01-16 19:38:35
问题 I'm creating a xml document based on some conditions in my app. the number of elements inside my xml is always variable. For instance, one time it may look like: <TransactionTypes> <X value="false" text="" /> <O value="false" text="" /> <E value="false" text="" /> <P value="false" text="" /> <C value="false" text="" /> <K value="false" text="" /> </TransactionTypes> and the other time like: <TransactionTypes> <TT value="false" text="" /> <EP value="false" text="" /> <PY value="false" text=""

Transform XML to add 'nil' attributes to empty elements

感情迁移 提交于 2020-01-16 19:35:50
问题 An existing XML feed we consume has a lot of properties whose values can be missing, and we want to treat these as NULL not optional or empty values because it makes enforcing strict typing harder and messes up our auto code generation and so on. For instance we might receive: <LASTUPDATED/> We have no formal XSD but are creating one ourselves... it might currently look like: <xs:element type="xs:dateTime" name="LASTUPDATED"/> This doesn't validate against the XML shown ( "" is not a valid

unable to validate SAML 2.0 assertion against schema

只愿长相守 提交于 2020-01-16 18:36:30
问题 I am working with Spring SAML and I have problem consuming SAML assertion (sample assertion from Wikipedia article <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="b07b804c-7c29-ea16-7300-4f3d6f7928ac" Version="2.0" IssueInstant="2004-12-05T09:22:05"> <saml:Issuer>https://idp.example.org/SAML2</saml:Issuer> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds

unable to validate SAML 2.0 assertion against schema

回眸只為那壹抹淺笑 提交于 2020-01-16 18:36:06
问题 I am working with Spring SAML and I have problem consuming SAML assertion (sample assertion from Wikipedia article <saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ID="b07b804c-7c29-ea16-7300-4f3d6f7928ac" Version="2.0" IssueInstant="2004-12-05T09:22:05"> <saml:Issuer>https://idp.example.org/SAML2</saml:Issuer> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">...</ds

No declaration found for element

旧城冷巷雨未停 提交于 2020-01-16 16:48:13
问题 I have a simple XML and XSD files. I am using Xerces to generate .h/cpp files but when I run the application it gives an error: no declaration found for element 'x:books' My XML file is: <?xml version="1.0"?> <x:books xmlns:x="urn:books" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:BookStore books.xsd"> <book id="bk001"> <author>Writer</author> <title>The First Book</title> <genre>Fiction</genre> <price>44.95</price> <pub_date>2000-10-01</pub_date> <review>An

MATLAB parse and store XML with XSD

若如初见. 提交于 2020-01-16 14:30:42
问题 I have an XSD for an XML file, which I was hoping would make it easier to parse and store the information in the XML. However, I am unable to find anything on the Mathworks website about such a thing. Does anyone know of a way to use my XSD to read the XML file (with MATLAB, if possible) and store the information contained in the XML file? Alternatively, is there some other way to do this (ie without MATLAB)? 回答1: Look, I've tried multiple options to read/write XML files. And believe me when

Type casting to another with the same properties

醉酒当歌 提交于 2020-01-16 07:18:11
问题 In one section of my application, I use type generated from xsd scheme - I have 2 version of schemas 2008 and 2009 - type I use is DatumType - in every scheme this type contain the same properties - they are exact, except namespaces. Is there any way how to cast DatumType (2008) to DatumType (2009) so I can work in my application only with one type, instead of two? I am working with c# and win forms, thanks! 回答1: No, there is no way to cast one to the other, because these are two unrelated

Selecting Nodes in XSD schema using Xpath

倾然丶 夕夏残阳落幕 提交于 2020-01-15 18:52:07
问题 I have the following code that I wish to use to select all the elements I will need in a certain sequence. Here's the snippet: XmlDocument schema = new XmlDocument(); schema.Load(SchemaFileName); XmlNamespaceManager xnm = new XmlNamespaceManager(schema.NameTable); xnm.AddNamespace("xs", "http://www.w3.org/2001/XMLSchema"); XmlNodeList list = schema.SelectNodes(Path); However, I'm not sure what I should write as the path. Ideally I want to select all the child nodes of the "sequence" tag, but