I recently encountered an issue with SAML metadata validation from a customer. The relevant part of metadata that is failing: This fails with the folowing error: cvc-complex-type.2.4.a: Invalid content was found starting with element ‘NameIDFormat’. One of ‘{“urn:oasis:names:tc:SAML:2.0:metadata”:SingleSignOnService, “urn:oasis:names:tc:SAML:2.0:metadata”:NameIDMappingService, “urn:oasis:names:tc:SAML:2.0:metadata”:AssertionIDRequestService, “urn:oasis:names:tc:SAML:2.0:metadata”:AttributeProfile, “urn:oasis:names:tc:SAML:2.0:assertion”:Attribute}’ is expected. The following is the relevant portion of saml-schema-metadata-2.0.xsd: I notice that the error message only specifies
Tag: xsd
Validation issues with polymorphic xml
We have some abstract elements defined in our root schema e.g.: … which are then extended as follows: These elements are used inside our xml file: However, when I try to validate the xml using Saxon command line, I get the error message below: Here is a link to the actual sample files for reference: xml / root schema –
JAXB UnMarshalling Renders Null Values (JAXB, Java 1.8)
I have an XSD which I have written like this: Now I generate the JAXB classes using CXF maven plugin. And i get a JAXB class like (used a decompiler for this): Now to get it out, I wrote a simple class that just takes a string and unmarshalls it: But that last line prints null. I was expecting it
XML validation against XSD with javax.xml.validation.Validator: cannot resolve types come from 2nd XSD
I am trying to write a method that validates XML against XSD. In my case, I have multiple XSD files. When I use tools like IntelliJ IDEA to generate a sample XML from my main XSD everything looks fine: the sample XML is generated and looks as I expect. So I think that my XSD files are okay. This is
xjc: Two declarations cause a collision in the ObjectFactory class
Running the following xjc command raises an error : Although I understand the JAXB bindings and what are is conflict in XJC, I don’t understand where is the conflict in the current schema. how should I fix this ? Thanks, Pierre update: here is the context of the errors: Answer I’ll quote from the most official unofficial guide on JAXB
wsimport – Two declarations cause a collision, same line given
Trying to use wsimport to generate a client for a SOAP endpoint. The WSDL and all XSD files used are local copies. This is the command being executed: Which gives this error: Note the line number is the same for the reported collision. Here’s the schema: I’ve tried removing the type definition, but it’s referenced in a slew of other
How to perform schematron validation using Saxon java library command line tool?
Very basic question- I’ve a xml file and I want to validate it against a schematron file. How do I do it using Saxon command line? As per commandline reference I don’t see any option to specify schematron file. Answer After doing a lot of research, it seems that it isn’t really possible. We have to first generate xsl document
Is it possible to generate a XSD from a JAXB-annotated class?
I’ve written a number of classes using JAXB for serialization and I was wondering if there was a way to generate a XSD file for each of these objects based on the annotations. Is there a tool for this? Something like generate-xsd com/my/package/model/Unit.java would be awesome. Does anything exist to do this? Answer Yes, you can use the generateSchema method
XML Schema to Java Classes with XJC
I am using xjc to generate Java classes from the XML schema and the following is an excerpt of the XSD. For the most part the generated classes are fine but for the above block I would get something like: with the following comment above it: I have placed a comment at the end of the two line in question.