Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Creating XML Templates Dynamically

575 views
Skip to first unread message

kilstromcraig

unread,
Dec 31, 2008, 3:51:49 PM12/31/08
to
I want to export XML from a datawindow using an XML template.

The default template is too basic. The template generated
automatically in the datawindow object painter works for us, but we do
not want to manually create templates for our thousands of
dataobjects.

How do I create an XML Template at runtime using PB11?

Paul Horan[Sybase]

unread,
Jan 2, 2009, 1:57:27 AM1/2/09
to
You need to export data from each and every one of your thousands of
datawindows?

I'm not sure it's possible... Even if you build the XMLSchema from the
resultset definition, the Datawindow.Data.XMLSchema and
Datawindow.Export.XML.Template[num].Name properties are not modifiable at
runtime.

I think that means you have to reference an XML template that's already
saved into the dw definition in the painter.

If you really need to export data as XML from any potential dw in your app,
I would look at building a generic XML export class that built the XML
output without using templates.

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"kilstromcraig" <kilstr...@yahoo.com> wrote in message
news:31c8c311-2ef1-4e11...@t39g2000prh.googlegroups.com...

craigkilstrom

unread,
Jan 5, 2009, 12:00:38 PM1/5/09
to
Perhaps we won't need xml from all of them, but there are
hundreds of reports and detailed information datawindows
(not even considering those created dynamically) that are
candidates for export.

The template generated by default in the datawindow painter
would work. The methods already exist. Couldn't they be
exposed at runtime, perhaps from within the PBDOM?

Paul Horan[Sybase]

unread,
Jan 5, 2009, 1:43:57 PM1/5/09
to
The template definition has to exist in the datawindow syntax.
My only advice is to spend a Saturday, buy some pizzas for the staff, and go
one by one.

Open datawindow.
View > Export/Import Template > XML
Save.

Repeat for each datawindow...

Then you'll have the default template saved into the datawindow syntax.

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

<Craig Kilstrom> wrote in message news:49623cb6.1b...@sybase.com...

kilstromcraig

unread,
Jan 6, 2009, 4:48:01 PM1/6/09
to
On Jan 5, 1:43 pm, "Paul Horan[Sybase]"

<phoran_remove@remove_sybase.com> wrote:
> The template definition has to exist in the datawindow syntax.
> My only advice is to spend a Saturday, buy some pizzas for the staff, and go
> one by one.
>
> Open datawindow.
> View > Export/Import Template > XML
> Save.
>
> Repeat for each datawindow...
>
> Then you'll have the default template saved into the datawindow syntax.
>
> --
> Paul Horan[Sybase]
> paulhoran.pbdjmagazine.com
>
>
>
> <Craig Kilstrom> wrote in messagenews:49623cb6.1b...@sybase.com...

> > Perhaps we won't need xml from all of them, but there are
> > hundreds of reports and detailed information datawindows
> > (not even considering those created dynamically) that are
> > candidates for export.
>
> > The template generated by default in the datawindow painter
> > would work. The methods already exist.  Couldn't they be
> > exposed at runtime, perhaps from within the PBDOM?- Hide quoted text -
>
> - Show quoted text -

I think I'll write a routine to spin through the rows and columns,
writing xml on the fly -- handles even dynamically-created dataobjects
and lot's easier for all concerned.

Thanks Paul for your continuing help on all things PowerBuilder.

0 new messages