xsd

Need assistance in creating an xsd

[亡魂溺海] 提交于 2019-12-25 17:18:46
问题 I'm new to xsd. I'm trying to create a xsd so that my xml should be in the following way.. <Info> <Val name="n_1">A</Val> <Val name="n_2">123</Val> <Val name="n_3">2012-05-05T00:00:00</Val> </Info> The xsd which I created is in this way.. <xs:element name="Info"> <xs:complexType> <xs:sequence> <xs:element name="n_1" type="xs:string"/> <xs:element name="n_2" type="xs:integer"/> <xs:element name="n_3" type="xs:dateTime"/> </xs:sequence> </xs:complexType> </xs:element> This obviously did not

Not allowing a specific string in an XSD Regular expression

妖精的绣舞 提交于 2019-12-25 17:05:17
问题 I'm trying to validate a restricted string using a regular expression ... <xs:simpleType name="myStringType"> <xs:restriction base="xs:string"> <xs:pattern value="^urn:mystuff:v1:(ABC\.(?!Acme).\S+\.\S+\.a\d+\.v\d+|ABC\.Acme\.\S+\.a\d+\.\d+\.\d+)$"/> </xs:restriction> </xs:simpleType> As you can see the regular expression I'm trying to use is ^urn:mystuff:v1:(ABC\.(?!Acme).\S+\.\S+\.a\d+\.v\d+|ABC\.Acme\.\S+\.a\d+\.\d+\.\d+)$ I would like the following to validate: urn:mystuff:v1:ABC.Test

The value '<!\[CDATA\[.*?\]\]>|[^<>&]*' of the facet 'pattern' is not a valid regular expression

和自甴很熟 提交于 2019-12-25 16:51:29
问题 I'm trying to use a regex to validate a field in my xml using xsd. I came up with the regex to do what I want which is to disallow special characters unless the text is wrapped in CDATA tags. This is the regular expression I came up with: <!\[CDATA\[.*?\]\]>|[^<>&]* Works great when I test it on http://regexr.com/ to match my pattern. The problem is when I try to then plug it into a simpleType pattern restriction I'm getting an error saying its not a valid regular expression. The value '<!\

Re-arranging XSD xs:sequence using xslt to convert to another xsd

非 Y 不嫁゛ 提交于 2019-12-25 16:49:41
问题 I have something like this: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="PRO"> <xs:sequence> <xs:element ref="LIC" minOccurs="0" maxOccurs="unbounded"> </xs:element> <xs:element ref="SPEC" minOccurs="0" maxOccurs="unbounded"> </xs:element> <xs:element ref="NPI" minOccurs="0" maxOccurs="unbounded"> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="LIC"> </xs:complexType> <xs:complexType name="SPEC"> </xs

Problem with Code Generated by XSD.EXE: Sequence of Elements is Generated as an Array

£可爱£侵袭症+ 提交于 2019-12-25 15:15:14
问题 I am trying to generate C# code from an XSD using xsd.exe Here is a snippet of the problematic area <xs:element name="EmailConfiguration" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="DefaultSendToAddressCollection" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="EmailAddress" type="xs:string" minOccurs="1" maxOccurs="unbounded" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element>

Missing Microsoft XML schema mystery

隐身守侯 提交于 2019-12-25 14:48:13
问题 I downloaded the XML schema's for Office 2003 from Microsoft's download site here so I can validate Excel documents that people upload to our app. Turns out that they don't work. I receive errors where it can't resolve the type like this: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'udcxf:File' to a(n) 'element declaration' component. I've traced this error to the fact that the udc.xsd file which makes a namespace reference to http://schemas.microsoft.com/data/udc

if condition for making hide some part of xml(WSDL) file in .xslt in mule

喜夏-厌秋 提交于 2019-12-25 14:45:07
问题 this is my .xslt file : <?xml version='1.0' ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:s="http://www.w3.org/2001/XMLSchema"> <xsl:output method="xml" version="1.0" encoding="UTF-8" omit-xml-declaration="yes" indent="yes" /> <xsl:param name="remoteClientAddress" /> <xsl:variable name="remoteClientAddressTrimmed" select="substring-before(substring-after($remoteClientAddress, '/'), ':')" /> <xsl:template

Validating xml. Get the element name that throws cvc-enumeration-valid

倾然丶 夕夏残阳落幕 提交于 2019-12-25 14:23:33
问题 Good Morning to everyone! I am validating an xml against an xsd in this way: ValidationEventCollector vec; URL xsdUrl; Schema schema; FicheroIntercambio fichero; vec = new ValidationEventCollector(); try{ xsdUrl = FicheroIntercambio.class.getResource("xsd/file.xsd"); SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); schema = sf.newSchema(xsdUrl); jaxbContext = JAXBContext.newInstance("file.dto"); unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller

Validating xml. Get the element name that throws cvc-enumeration-valid

為{幸葍}努か 提交于 2019-12-25 14:23:29
问题 Good Morning to everyone! I am validating an xml against an xsd in this way: ValidationEventCollector vec; URL xsdUrl; Schema schema; FicheroIntercambio fichero; vec = new ValidationEventCollector(); try{ xsdUrl = FicheroIntercambio.class.getResource("xsd/file.xsd"); SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/2001/XMLSchema"); schema = sf.newSchema(xsdUrl); jaxbContext = JAXBContext.newInstance("file.dto"); unmarshaller = jaxbContext.createUnmarshaller(); unmarshaller

How to create xsd which can preserve space in xml?

喜夏-厌秋 提交于 2019-12-25 11:45:44
问题 how can I create XML Schema which can preserve space in the xml ... 回答1: you mean you wannt to create xml schema that can preserve the space in xml , If that is the question then here is the ans below The element which you want to preserve the space just create your own data type for that element. For Ex:- <xs:simpleType name="TitleString"> <xs:restriction base="xs:string"> <xs:whiteSpace value="preserve"/> <xs:minLength value="5"/> <xs:maxLength value="230"/> </xs:restriction> </xs