[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML Schema help

  • To: <mike@s...>, <xml-dev@l...>
  • Subject: RE: XML Schema help
  • From: <sharma.tarun@w...>
  • Date: Thu, 19 Jan 2006 22:31:05 +0530
  • References: <20060119125700.E5CB23F4006@w...>
  • Thread-index: AcY1TQZTctq5XOpwQ6GcyEXum2ApNgYVbKuQDCJyor0=
  • Thread-topic: XML Schema help

rss xml schema
Title: RE: XML Schema help

Hi Michail,
Probably you are right. Actually as I told you I am very new to XML technology. Thats why I am so unsure about the things I am doing. But I need to come up with the solution. I think first step is to write the schema and then I need some transformation mechanism to change the plain text to the xml output. But during this implementation I couldnt find a way to  map the command parameters to the schema. Can you suggest me something for this or probably some good tutorial on how to write xml schema.

Thanks a lot
regards
-tarun


-----Original Message-----
From: Michael Kay [mailto:mike@s...]
Sent: Thu 19-Jan-06 18:26
To: Tarun Sharma (WT01 - Software Products & OSS); xml-dev@l...
Subject: RE: XML Schema help

I think you may be misunderstanding the role of XML Schema here. The example
document you have shown is very simple and there should be no difficulty
writing a schema for it. Your real challenge is how to do the transformation
(up-conversion) from the original non-XML input to your desired XML output.
XML Schema can describe the output, but to describe the transformation you
need a different tool. XSLT 2.0 is a good candidate in this area, unless you
already have a preferred technology in mind.

Michael Kay
http://www.saxonica.com/


  _____ 

From: sharma.tarun@w... [mailto:sharma.tarun@w...]
Sent: 19 January 2006 12:06
To: xml-dev@l...
Cc: sharma.tarun@w...
Subject: XML Schema help
Importance: High



Hi,

I am very new user of XML and first time writing some XML schema for parsing
commands input as well as response. My commands have some structure like
this:

RUNTCP:PORT=124,IP1=192,IP2=168,IP3=10,IP4=12,RIP="230.164.12.8"



The requirement is such that I need to generate commands from the given
attributes or parameters.  The whole program should be independent of the
commands and their parameters.



Similarly I get the output in following format



RUNTCP OUTPUT DATA



PORT   IP1    IP2    IP3    IP4 

Port1   ip1      ip2    ip3     ip4

.

.

.

.

.

ERROR CODE

BROKEN PIPE

END



The other example could be



GETTCP

PORT   IP1    IP2    IP3    IP4 

Port1   ip1      ip2    ip3     ip4



Port2



Port3

.

.

.

.

.

NONE

ERROR CODE

BROKEN PIPE

END



Only ports are getting repeated in this case.







Which means that the output will give us some parameters and it can give
some errors like ERROR CODE

 or BROKEN PIPE  etc. Finally it ends with the end.







I also need to parse this output to get the desired results. Here is the
example schema I wrote for the output:

<?xml version="1.0" ?>

- <GATEWAY>

- <command name="RUNTCP" versions="4.0">

   - <output start=" RUNTCP OUTPUT DATA" end="END" none="NONE" error="ERROR
CODE" bp="BROKEN PIPE">

            - <section start="MG" end="MG" repeatable="yes" mandatory="yes">

                        - <paramset start="PORT" mandatory="yes">

                                    <param name="PORT" key="yes"
mandatory="yes" />

                        </paramset>



                        - <paramset start="IP1" mandatory="yes">

                                    <param name="IP1" mandatory="yes" />

                        </paramset>



                        - <paramset start="IP2" mandatory="yes">

                                    <param name="IP2" mandatory="yes" />

                        </paramset>

           

                        - <paramset start="IP3" mandatory="no">

                                    <param name="IP3" mandatory="yes" />

                        </paramset>

           

                        - <paramset start="IP4" mandatory="no">

                                    <param name="IP4" mandatory="yes" />

                        </paramset>

             </section>

  </printout>

 </command>



Can anybody suggest me some solution schema for it.





Thanks in advance

Regards

Tarun sharma


The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com
       



The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.