我觉得这个XML无效,有人可以解释一下原因吗?
我认为它有点东西这个点我的元素名称?
estate_price.price_suggestion
还有什么其他的东西对这个XML无效吗?
XML
\\ <?xml version="1.0" encoding="UTF-8"?>
<iad>
<DataTag>
<element id="0">
<changed_string>content</changed_string>
<no_of_bedrooms>content</no_of_bedrooms>
<published_string>content</published_string>
<mmo>content</mmo>
<postcode>content</postcode>
<utmx>content</utmx>
<utmy>content</utmy>
<disposed>content</disposed>
<property_type>content</property_type>
<isprivate>content</isprivate>
<heading>content</heading>
<published>content</published>
<estate_price.price_suggestion>content</estate_price.price_suggestion>
<ownership_type>content</ownership_type>
<estate_size.useable_area>content</estate_size.useable_area>
<adid>content</adid>
<address>content</address>
<sqmtrprice>content</sqmtrprice>
<estate_size.primary_room_area>content</estate_size.primary_room_area>
<location>content</location>
<changed>content</changed>
<orgname>content</orgname>
</element>
<element id="1">
<changed_string>content</changed_string>
<no_of_bedrooms>content</no_of_bedrooms>
<published_string>content</published_string>
<mmo>content</mmo>
<postcode>content</postcode>
<utmx>content</utmx>
<utmy>content</utmy>
<disposed>content</disposed>
<property_type>content</property_type>
<isprivate>content</isprivate>
<heading>content</heading>
<published>content</published>
<estate_price.price_suggestion>content</estate_price.price_suggestion>
<ownership_type>content</ownership_type>
<estate_size.useable_area>content</estate_size.useable_area>
<adid>content</adid>
<address>content</address>
<sqmtrprice>content</sqmtrprice>
<estate_size.primary_room_area>content</estate_size.primary_room_area>
<location>content</location>
<changed>content</changed>
<orgname>content</orgname>
</element>
</DataTag>
</iad>
Run Code Online (Sandbox Code Playgroud) 我的xml标签如下
<ADCNT>
<EM>
<RUID>
</ADCNT>
Run Code Online (Sandbox Code Playgroud)
我可以通过提供()使EM标签成为强制标签也是同样的事情.但我想如果它们都不存在则不要对模式验证xml.如果其中任何一个存在,则根据模式验证xml.意味着如果标签不存在则必须存在标签,反之亦然.RUIDminOccurs = 1<EM minOccurs=1>EMRUID
那么,如何解决这个问题呢?
谢谢Sunil kumar Sahoo
我需要接受XML并根据模式文件对其进行验证.之后我必须根据命令调用一个函数(例如updateContactList).做这个的最好方式是什么?我担心验证XML(并报告错误),我不知道将数据放入函数运行的最佳方法是什么
-edit-注意:通过验证模式,我需要验证(正则表达式)模式.如果我可以使用XML和模式调用函数并使其返回false + error msg或true,那将是很好的
我使用sqlFile包含一个sql脚本,该脚本使用oracle特定命令创建表(NOCACHE,NO PARALLEL,类似的东西).我的master.xml文件包含所有sql脚本并执行它们.但是,当它检测到标记时,它会失败并打印此错误消息.
C:\update.bat master.xml
Migration Failed: cvc-complex-type.2.4.a: Invalid content was found starting with element 'sqlFile'.
One of '{
"http://www.liquibase.org/xml/ns/dbchangelog/1.9":preConditions,
"http://www.liquibase.org/xml/ns/dbchangelog/1.9":property,
"http://www.liquibase.org/xml/ns/dbchangelog/1.9":changeSet,
"http://www.liquibase.org/xml/ns/dbchangelog/1.9":include,
"http://www.liquibase.org/xml/ns/dbchangelog/1.9":includeAll
}' is expected.
Run Code Online (Sandbox Code Playgroud)
我的master.xml非常简单
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9 http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
<sqlFile path="createUsers.sql"/>
</databaseChangeLog>
Run Code Online (Sandbox Code Playgroud)
任何想法将不胜感激.提前致谢.
我遇到了一个传统的XSD,有很多像......
<xs:element minOccurs="1"
maxOccurs="1"
default="true"
name="Ready" type="xs:boolean" />
Run Code Online (Sandbox Code Playgroud)
...其中minOccurs和maxOccurrs都等于1,并且有一个默认值.这里有默认属性是否有任何好处,因为XML doc需要以任何方式包含某些值?
我有一个项目,我们正在处理的主文件是一个旧的XML文件,其中创建者创建了一个非结构化的DTD(所有元素都是可选的,可以发生0次或更多次.更好的是,读取文件的应用程序实际上需要很多根据需要的值).我根据已知的应用程序要求创建了一个XSD,并将无序元素列表移动到XSD中的序列中.
是否有一个简单的转换过程(例如XSLT)可以获取旧的XML文件,并以指定的方式对其元素进行排序,以便我们可以使用新的XSD来验证它?
例:
<Top>
<A/>
<D/>
<B/>
<C/>
<A/>
</TOP>
Run Code Online (Sandbox Code Playgroud)
INTO
<Top>
<A/>
<A/>
<B/>
<C/>
<D/>
</TOP>
Run Code Online (Sandbox Code Playgroud)
孩子们也可能有元素需要也被分类到新的序列预期排序.谢谢!
当试图在XML spy中显示XML Schema时,我收到以下错误."架构必须以命名空间中的元素' http://www.w3.org/2001/XMLSchema ' 开头"
我用一个简单的示例xml尝试了它并得到了同样的错误
<?xml version="1.0"?>
<Book xmlns:lib="http://www.library.com">
<lib:Title>Sherlock Holmes</lib:Title>
<lib:Author>Arthur Conan Doyle</lib:Author>
</Book>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
为什么这是非确定性的以及如何解决它?
<xs:element name="activeyears">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="1">
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element ref="from" minOccurs="1" maxOccurs="1"/>
<xs:element ref="till" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:element ref="from" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
Run Code Online (Sandbox Code Playgroud)
它应该意味着它<activeyears>是空的或包含序列<from><till>开头<from>但可以以任何一个结束.