This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Microsoft XML > February 2004 > Advice on extending types under XSD?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Advice on extending types under XSD?
Charles Fineman

2004-02-25, 9:29 am

Say i've got a type that appears in a request... say it represents a
shipment. I want it to contain things like from and to address elements
as well as a sequence of the pieces being shipped.

Say the operation is supposed to calculate the cost to ship each piece.
I would like the response type to look just like the request type but
with a price element under each of the item types. For example:

Request:
<shipment>
<from/>
<to/>
<pieces>
<piece>
<weight>100</weight>
</piece>
<piece>
<weight>5</weight>
</piece>
</pieces>
</shipment>

Response:
<shipment>
<from/>
<to/>
<pieces>
<piece>
<weight>100</weight>
<cost>10.00</cost>
</piece>
<piece>
<weight>5</weight>
<cost>5.00</cost>
</piece>
</pieces>
</shipment>

It would be great if I could easily extend the request type to turn it
into the response type but I'm not sure there is an easy way to do that.

Any thoughts?

Han

2004-02-27, 1:30 pm

Sounds like XSLT rather than XSD.

"Charles Fineman" <cfineman-no&spam@yahoo.com> wrote in message
news:7543b$403ca2de$d89e2d9a$4775@dcanet.allthenewsgroups.com...
> Say i've got a type that appears in a request... say it represents a
> shipment. I want it to contain things like from and to address elements
> as well as a sequence of the pieces being shipped.
>
> Say the operation is supposed to calculate the cost to ship each piece.
> I would like the response type to look just like the request type but
> with a price element under each of the item types. For example:
>
> Request:
> <shipment>
> <from/>
> <to/>
> <pieces>
> <piece>
> <weight>100</weight>
> </piece>
> <piece>
> <weight>5</weight>
> </piece>
> </pieces>
> </shipment>
>
> Response:
> <shipment>
> <from/>
> <to/>
> <pieces>
> <piece>
> <weight>100</weight>
> <cost>10.00</cost>
> </piece>
> <piece>
> <weight>5</weight>
> <cost>5.00</cost>
> </piece>
> </pieces>
> </shipment>
>
> It would be great if I could easily extend the request type to turn it
> into the response type but I'm not sure there is an easy way to do that.
>
> Any thoughts?
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews