Olá
Links tirados da minha palestra sobre web services no Conexão Java 2006 que podem ser baixadas em http://www.guj.com.br/posts/list/46354.java#242800
[b][color=red] Visualização, validação e geração de Schemas[/color]
- Linha de comando (ou página web):[/b]
xsv:
http://www.ltg.ed.ac.uk/~ht/xsv-status.html
XSD Inference (gera schema a partir do XML)
http://msdn.microsoft.com/XML/XMLDownloads/default.aspx
XML Utilities (página web que gera schema a partir do XML ou converte DTD)
http://www.hitsw.com/xml_utilites/
- Interface gráfica:
XML Notepad 2006
XMLSPY
- API programática:
Xerces2:
http://xerces.apache.org/xerces2-j/
MSXML 6.0
http://msdn.microsoft.com/XML/XMLDownloads/default.aspx
Exemplo de geração de schema (tirado de 2-Schemas.pdf )
Vamos usar o infer baixado da Microsoft para gerar um schema a partir do arquivo XML BookStore.xml (no PDF)
O infer é XSD Inference Command Line e seu uso é o seguinte:
Infer [-v] file1 [file2 [… fileN]] [-o schemaName.xsd]
Onde:
-v = optional, validates the input file(s) against the result schema collection
file1,…fileN = one or more xml docs. Infer.exe will infer the schema collection from the first document and refine the schema using the rest of the xml documents.
-o schema.xsd = optional, name of the file to write schema(s) to Infer.exe will create a separate file for each schema inferred: schema_1.xsd, schema_2.xsd, etc.
Para criar um schema:
C:\CJ06\Schemas>infer BookStore.xml -o BookStoreInfer.xsd
Microsoft ® XSD Inference Command Line Utility V1.0
Copyright © Microsoft Corporation 1998-2002. All rights reserved.
C:\CJ06\Schemas>
[]s
Luca