Tag: xsd

无法找到BeanDefinitionParser for Spring Web服务的元素

我是Spring Web服务的新手,我不断收到此错误: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [annotation-driven] Offending resource: ServletContext resource [/WEB-INF/spring-ws-servlet.xml] 经过一番挖掘后,看起来我很可能在我的架构和jar子之间存在版本不匹配但我看不到哪里(我正在为v3.1拍摄)。 这是我库中的每个Spring jar: M2_REPO\org\springframework\spring-aop\3.1.1.RELEASE\spring-aop-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-asm\3.1.1.RELEASE\spring-asm-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-beans\3.1.1.RELEASE\spring-beans-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-context\3.1.1.RELEASE\spring-context-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-context-support\3.1.1.RELEASE\spring-context-support-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-core\3.1.1.RELEASE\spring-core-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-expression\3.1.1.RELEASE\spring-expression-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-jdbc\3.1.1.RELEASE\spring-jdbc-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-jms\3.1.1.RELEASE\spring-jms-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-oxm\3.1.1.RELEASE\spring-oxm-3.1.1.RELEASE.jar M2_REPO\org\springframework\ws\spring-oxm\1.5.10\spring-oxm-1.5.10.jar M2_REPO\org\springframework\ws\spring-oxm-tiger\1.5.10\spring-oxm-tiger-1.5.10.jar M2_REPO\org\springframework\security\spring-security-acl\3.1.1.RELEASE\spring-security-acl-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-config\3.1.1.RELEASE\spring-security-config-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-core\3.1.1.RELEASE\spring-security-core-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-remoting\3.1.1.RELEASE\spring-security-remoting-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-taglibs\3.1.1.RELEASE\spring-security-taglibs-3.1.1.RELEASE.jar M2_REPO\org\springframework\security\spring-security-web\3.1.1.RELEASE\spring-security-web-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-test\3.1.1.RELEASE\spring-test-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-tx\3.1.1.RELEASE\spring-tx-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-web\3.1.1.RELEASE\spring-web-3.1.1.RELEASE.jar M2_REPO\org\springframework\spring-webmvc\3.1.1.RELEASE\spring-webmvc-3.1.1.RELEASE.jar M2_REPO\org\springframework\ws\spring-ws-core\2.1.2.RELEASE\spring-ws-core-2.1.2.RELEASE.jar M2_REPO\org\springframework\ws\spring-ws-core-tiger\1.5.10\spring-ws-core-tiger-1.5.10.jar M2_REPO\org\springframework\ws\spring-xml\1.5.10\spring-xml-1.5.10.jar 弹簧-WS-servlet.xml中 web.xml中 My Webservice Created By Archetype for Spring WS spring-ws […]

架构validationandroid

在java有类SchemaFactory ,它用于模式validation,但在android中不可用。 还有其他选择吗?

JAXB文档注释

我有以下带有JAXB @XMLRootElement注释的java类 @XmlRootElement(name=”ClientData”) public class ClientData { /** * The first address field of the person */ private String address1 = null; } 当我生成xsd架构时,它会生成这个xml片段 是否可以使用JAXB注释,以便在我的最终模式中将address1字段的文档详细信息包含为xs:annotation / xs:documentention元素? The first address field of the person

的SAXParseException; src-resolve:无法将名称“…”解析为(n)’类型定义’组件

我正在尝试进行模式validation,目前使用的是javax.xml.validation.SchemaFactory 。 不幸的是,当我调用newSchema(Source schema)函数时,我收到以下错误: Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/C42056/Documents/workspace-sts-3.2.0.RELEASE/cec-sample-ws-integration-2-war/target/classes/WEB-INF/schemas/xsd/individual/PrivateComponentTypes_4_0.xsd; lineNumber: 33; columnNumber: 88; src-resolve: Cannot resolve the name ‘utility:ObjectStatusDateType’ to a(n) ‘type definition’ component. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseLocal(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseLocalElements(Unknown Source) at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source) at […]

使用Java代码进行XMLvalidation

我需要一些代码示例,它展示了如何针对模式validationxml文件。 以下是我的XML文档: January 21 1983 我想要validation上述XML的模式是: 现在有人可以帮我编写Java代码,如果XML文档根据我指定的模式是有效的,那么它将把这些作为输入并给出正确的输出吗? 现在我有一个问题理解下面的代码,比如MySAXHandler上的方法如何调用becoz,类没有被实例化,方法也没有被明确地调用。 谁有人解释一下? 还有什么方法我可以直接传递文件而不是通过字符串。 代码是 – import java.io.StringReader; import javax.xml.XMLConstants; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.sax.SAXSource; import javax.xml.validation.SchemaFactory; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import org.xml.sax.helpers.DefaultHandler; public class XMLval { public static void main(String args[])throws Exception { SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser parser = null; […]

JAXB问题:nameXmlTransform typeName前缀不起作用

我希望将几个模式转换为Java代码。 模式都很相似; 例如,每个人都有一个TXLife根对象。 如果每个模式生成具有唯一类名的代码,则管理代码会更容易。 我可以使用“package”绑定将每个模式的代码放入自己的包中,但是当我尝试使用“prefix”绑定来更改类名时,它会忽略它。 这是我的schema_bindings.xml文件: 当我运行xjc命令时,我得到了(我必须修改xjc.bat文件中的类路径才能使其工作): C:\ test> \ progs \ Java \ jaxb-ri-2.2.7 \ bin \ xjc.bat -extension -d src -b schema_bindings.xml schemas 解析模式…… 编译模式…… COM \ myCompany的\喜\ Holding.java COM \ myCompany的\喜\ InquiryLevel.java COM \ myCompany的\喜\ KeyedValue.java COM \ myCompany的\喜\ OLifE.java COM \ myCompany的\喜\ ObjectFactory.java COM \ myCompany的\喜\ Policy.java COM \ myCompany的\喜\ TXLife.java […]

jaxb,xsd导入无法识别

我有一个jaxb插件的大问题。 我有一个项目A,我有src / main / resources / xsd / common.xsd文件。 在这个项目中,我使用cxf-xjc-plugin来生成java类。 我还有我的episod文件在src / main / resources / META-INF下名为sun-jaxb.episode 接下来,我有项目B,它对项目A有maven依赖。在这个项目中我有src / main / resources / catalog.txt PUBLIC “http://www.some_path” “maven:GROUP_ID_OF_PROJECT_A:ARTIFACT_ID_OF_PROJECT_A:jar::!/common.xsd” 在项目BI中有pom文件和jaxb插件 org.jvnet.jaxb2.maven2 maven-jaxb2-plugin true GROUP_ID_OF_PROJECT_A ARTIFACT_ID_OF_PROJECT_A src/main/resources/catalog.txt 接下来,我在项目B中 src/main/resources/other/xsd my main.xsd 我使用common.xsd中的类型定义的文件 我有xmlns:cmns =“http://www.some_path”//它与catalog.txt中的相同 但问题是我得到错误未定义简单或复杂类型,因为它不识别cmns

使用XSD / trang HTML进行Java HTML 5validation5放宽NG到XSD的转换

我的目标是在java中使用XSD架构进行独立的HTML 5标记validation。 在下面我描述我的方法。 任何帮助都表示赞赏 – 如果有替代或更好的方法可以做到这一点。 WHATTF发布了针对HTML 5的Relax NG / Schematron模式 。 Trang [3]是一个用于不同XML模式语言的开源转换器,应该能够从Relax NG转换为XSD。 使用WHATTF模式,可以按如下方式调用trang转换器: $ java -jar ./trang.jar ./whattf/syntax/relaxng/html5.rnc html5.xsd 但是,trang会因错误的类型转换而产生以下许多变形: whattf/syntax/relaxng/applications.rnc:265:51: warning: cannot convert datatype library “http://whattf.org/datatype-draft”; using datatype “string” […] 我认为要让trang工作,需要将pluggable-datatypes [4]传递给jing。 Jing [5]是一个Relax NGvalidation器,我认为它是由trang使用的。 在whattf / syntax / relaxng / datatype文件夹中,提供了这些pluggable-datatypes的java实现。 因此,我创建了一个html5-datatypes.jar并将其添加到trangs类路径中,如下所示: $ java -cp ./html5-datatypes.jar -jar ./trang.jar ./whattf/syntax/relaxng/html5.rnc html5.xsd […]

什么可能导致“JAXBElement没有no-arg默认构造函数”?

我正在生成一个jar子,它将被放入商业软件产品中。 该jar符合商业软件的api并依赖于第二个jar,其中包含(除其他外)从XSD生成的一组POJO。 但是,当我将它放入时尝试实例化JAXBContext时它失败了。 我明白了: “1 counts of IllegalAnnotationExceptions” javax.xml.bind.JAXBElement does not have a no-arg default constructor. this problem is related to the following location: at javax.xml.bind.JAXBElement at mypackage.MyClass … JAXBContext.newInstance(“mypackage”); … 我的XSD(简洁总结)如下所示: … 我想也许问题是“xsd:element”级别的类不存在,但即使我将XJC设置为创建MyClass并且我已经validationMyClass有一个公共的无参数构造函数,问题仍然存在。 所以,我看了几个其他的SO问题(实际上是互联网上的)。 他们都没有给我足够的理解来解决这个问题,这可能只是对我的反思。 任何人都能有所了解吗? 或者给我另外的测试来打破这个?

具有XML Schema本地副本的XML文件

我正在尝试一些XML Schema示例,并且必须使用示例XML文件对它们进行validation。 架构是本地文件(someFile.xsd)。 我正在使用eclipse并希望在XML文件中包含一个引用来指向这个本地xsd文件,以便eclipse可以向我建议这些元素。 我发现很难想出包含本地文件的语法。 有什么建议么 ?