Thread View: borland.public.delphi.xml
3 messages
3 total messages
Started by RT
Wed, 28 May 2008 20:16
Another Newbie question
Author: RT
Date: Wed, 28 May 2008 20:16
Date: Wed, 28 May 2008 20:16
110 lines
5242 bytes
5242 bytes
I created a xsd file using liquid technologies' studio product. When I use
the xml data binding wizard it only generates 'get' functions for the
porperties and no 'put' procedures. Each element agfter the root node is a
complex type and each of those have a few elements each of which is an
unbounded list. It generates new, load and get but no save. What am I
doing wrong?
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid XML Studio 1.0.8.0
(http://www.liquid-technologies.com) -->
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Components">
<xs:complexType>
<xs:sequence>
<xs:element name="Ferrules">
<xs:complexType>
<xs:choice>
<xs:element maxOccurs="unbounded" name="Style"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Manufacturer"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Supplier"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Material"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Construction"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Color"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="ColorAgent"
type="xs:string" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Guides">
<xs:complexType>
<xs:choice>
<xs:element maxOccurs="unbounded" name="Style"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Manufacturer"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Supplier"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Material"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Color"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="ColorAgent"
type="xs:string" />
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Wraps">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Manufacturer"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Supplier"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Material"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Color"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="FinishMaterial"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ReelSeats">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Style"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Manufacturer"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Supplier"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Material"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Color"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="FinishMaterial"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Inserts">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" name="Style"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Manufacturer"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Supplier"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Material"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="Color"
type="xs:string" />
<xs:element maxOccurs="unbounded" name="FinishMaterial"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Re: Another Newbie question
Author: Mikael Eriksson
Date: Thu, 29 May 2008 07:55
Date: Thu, 29 May 2008 07:55
19 lines
1434 bytes
1434 bytes
Here is some code that uses the generated code.
Adds two Style nodes to the Guides node.
Adds one Manufacturer node to the Wraps node.
Saves the xml document to c.xml
procedure TForm1.Button1Click(Sender: TObject);
var
c: IXMLComponents;
begin
c := NewComponents;
c.Guides.Style.Add('GuideStyle1');
c.Guides.Style.Add('GuideStyle2');
c.Wraps.Manufacturer.Add('WrapManu');
c.OwnerDocument.SaveToFile('c.xml');
end;
regards
/MIcke
Re: Another Newbie question
Author: RT
Date: Thu, 29 May 2008 15:40
Date: Thu, 29 May 2008 15:40
29 lines
2047 bytes
2047 bytes
Thanks for the help. I have only worked with one other xml file and it had
no stringlists. Every element had a get and set and a save procedure for
the file ws generated so I presumed that the same would happen with the
stringlists. I implemented your example and everything works. I learn a
little more each day.
Thanks again.
"Mikael Eriksson" <micke314@gmail.com> wrote in message
news:483e613b@newsgroups.borland.com...
> Here is some code that uses the generated code.
> Adds two Style nodes to the Guides node.
> Adds one Manufacturer node to the Wraps node.
> Saves the xml document to c.xml
>
> procedure TForm1.Button1Click(Sender: TObject);
> var
> c: IXMLComponents;
> begin
> c := NewComponents;
> c.Guides.Style.Add('GuideStyle1');
> c.Guides.Style.Add('GuideStyle2');
> c.Wraps.Manufacturer.Add('WrapManu');
> c.OwnerDocument.SaveToFile('c.xml');
> end;
>
> regards
>
> /MIcke
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads