当前在线人数8135
首页 - 分类讨论区 - 电脑网络 - WWW明日之星版 - 同主题阅读文章

此篇文章共收到打赏
0

  • 10
  • 20
  • 50
  • 100
您目前伪币余额:0
未名交友
[更多]
[更多]
XML schema questions
[版面:WWW明日之星][首篇作者:cubic] , 2004年07月29日15:43:22 ,2482次阅读,5次回复
来APP回复,赚取更多伪币 关注本站公众号:
[分页:1 ]
cubic
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 1 ]

发信人: cubic (黑猫), 信区: XML
标  题: XML schema questions
发信站: Unknown Space - 未名空间 (Thu Jul 29 15:43:22 2004) WWW-POST

I am new in XML and need some help.

for example

xml schema is

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            targetNamespace="http://www.demo.org"
            xmlns="http://www.demo.org"
            elementFormDefault="qualified">
    <xsd:element name="Demo">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="A" type="xsd:integer"/>
                <xsd:element name="B" type="xsd:integer"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

In xml

<?xml version="1.0"?>
<Demo xmlns="http://www.demo.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.demo.org demo.xsd">
    <A>10</A>
    <B>20</B>
</Demo>

I can change demo.xsd to abcd.abcd (a trash name) and I do not get any error.
So how do I know are there errors in my schema file?

What is the usage of schema? To me it seems that it defines nothing. No like
DTD. I have to follow the definitions in DTD

Thanks


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 208.46.]

 
Phoenix
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 2 ]

发信人: Phoenix (有凤来仪), 信区: XML
标  题: Re: XML schema questions
发信站: Unknown Space - 未名空间 (Sat Jul 31 21:56:36 2004), 转信

Which XML parser are u using? For apache parser, you need to set the
external schema location in parser setup code.
【 在 cubic (黑猫) 的大作中提到: 】
: I am new in XML and need some help.
: for example
: xml schema is
: <?xml version="1.0"?>
: <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
:             targetNamespace="http://www.demo.org"
:             xmlns="http://www.demo.org"
:             elementFormDefault="qualified">
:     <xsd:element name="Demo">
:         <xsd:complexType>
:             <xsd:sequence>
:                 <xsd:element name="A" type="xsd:integer"/>
:                 <xsd:element name="B" type="xsd:integer"/>
:             </xsd:sequence>
:         </xsd:complexType>
:     </xsd:element>
: </xsd:schema>
: In xml
: <?xml version="1.0"?>
: <Demo xmlns="http://www.demo.org"
: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
:  xsi:schemaLocation="http://www.demo.org demo.xsd">
:     <A>10</A>
:     <B>20</B>
: </Demo>
: I can change demo.xsd to abcd.abcd (a trash name) and I do not get any error.
: So how do I know are there errors in my schema file?
: What is the usage of schema? To me it seems that it defines nothing. No like
: DTD. I have to follow the definitions in DTD
: Thanks


--
Asi es la vida!

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 128.120.]

 
cubic
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 3 ]

发信人: cubic (黑猫), 信区: XML
标  题: Re: XML schema questions
发信站: Unknown Space - 未名空间 (Mon Aug  2 11:36:18 2004) WWW-POST

Thank you for answering.

I do not use parser. Actually I do not have server. I just wrote xml file and
schema file. Then put them in the same folder.

OK I am new in XML and I am a little stupid. I just used XML to store data
(some servlet info) for JSP server. No schema and DTD

2 more questions. Please help
1. To use schema, do I need a server (or application like java, perl) to
handle it?
2. If no need server, how can I validate the schema (to check are there bugs
in schema)
   If doesn't matter, how can I work on my local PC?

Highly appricated


【 在 Phoenix (有凤来仪) 的大作中提到: 】
: Which XML parser are u using? For apache parser, you need to set the
: external schema location in parser setup code.


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 208.46.]

 
Phoenix
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 4 ]

发信人: Phoenix (有凤来仪), 信区: XML
标  题: Re: XML schema questions
发信站: Unknown Space - 未名空间 (Tue Aug  3 04:06:28 2004), 转信

I don't know if there is way to validate XML file against schema w/o parser.
If using parser is ok w/ ur situation, u can find a parser and reference
at apache.org
To check bugs in schema is easy, if you have visual studio .net, just
load it into ide.
I am not expert of XML either but I happen to mess w/ apache C++ parsers
a lot.
【 在 cubic (黑猫) 的大作中提到: 】
: Thank you for answering.
: I do not use parser. Actually I do not have server. I just wrote xml file and
: schema file. Then put them in the same folder.
: OK I am new in XML and I am a little stupid. I just used XML to store data
: (some servlet info) for JSP server. No schema and DTD
: 2 more questions. Please help
: 1. To use schema, do I need a server (or application like java, perl) to
: handle it?
: 2. If no need server, how can I validate the schema (to check are there bugs
: in schema)
:    If doesn't matter, how can I work on my local PC?
: Highly appricated
: 【 在 Phoenix (有凤来仪) 的大作中提到: 】
: : Which XML parser are u using? For apache parser, you need to set the
: : external schema location in parser setup code.


--
Asi es la vida!

※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 64.166.]

 
danalc
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 5 ]

发信人: danalc (dana), 信区: XML
标  题: Re: XML schema questions
发信站: Unknown Space - 未名空间 (Thu Oct 21 00:27:09 2004) WWW-POST


use Altova XMLSpy, home edition is free.


【 在 Phoenix (有凤来仪) 的大作中提到: 】
: I don't know if there is way to validate XML file against schema w/o parser.
: If using parser is ok w/ ur situation, u can find a parser and reference
: at apache.org
: To check bugs in schema is easy, if you have visual studio .net, just
: load it into ide.
: I am not expert of XML either but I happen to mess w/ apache C++ parsers
: a lot.
: 【 在 cubic (黑猫) 的大作中提到: 】
: : Thank you for answering.
: : I do not use parser. Actually I do not have server. I just wrote xml file
and
: : schema file. Then put them in the same folder.
: : OK I am new in XML and I am a little stupid. I just used XML to store data
: : (some servlet info) for JSP server. No schema and DTD
: : 2 more questions. Please help
: : 1. To use schema, do I need a server (or application like java, perl) to
: : handle it?
: : 2. If no need server, how can I validate the schema (to check are there
bugs
: : in schema)
: :    If doesn't matter, how can I work on my local PC?
: : Highly appricated
: : 【 在 Phoenix (有凤来仪) 的大作中提到: 】
: : : Which XML parser are u using? For apache parser, you need to set the
: : : external schema location in parser setup code.
:
:


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 24.8.]

[分页:1 ]
[快速返回] [ 进入WWW明日之星讨论区] [返回顶部]
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996