Re: [web2py] Re: XML manipulation

2011-03-21 Thread Richard Vézina
Yes to much idea to make them all!

R

On Mon, Mar 21, 2011 at 9:09 PM, villas  wrote:

> Hi Richard,
>
> In my case I was making the XML fit a specification given to me by
> someone else. It isn't very flexible to change it,  but I doubt that
> the specification will be changing much either.
>
> It is a pity there isn't a Zen of XML saying there should ideally be
> just one obvious way of doing something. During my hours of research I
> had so many ideas that I had to go and take an aspirin!
>
> -D
>
>
> On Mar 21, 5:25 pm, Richard Vézina 
> wrote:
> > It is not bad for start... But what happen when you change your query in
> > term of number of columns or rows? Do you have to make an other template
> > each time... Personnaly I don't like xml that much, so I don't want to
> have
> > to get back at editing my template all the time.
> >
> > Richard
> >
> > On Mon, Mar 21, 2011 at 1:19 PM, villas  wrote:
> > > Hi Richard
> >
> > > As a novice, the easiest solution I found was something like this:
> >
> > > * create wordml.xml template in views/default/ folder
> > > * prepare the xml, place variables for the data
> > > * create a wordml function in controller
> > > * manipulate your data into the variables in the controller ready to
> > > place in the template
> > > * call the function with url wordml.xls
> >
> > > This is adequate for me,  but may be too simple for your case. Mart
> > > may have something better, but 'simple' is about my limit, and I
> > > already lost almost a day studying other methods :-)
> >
> > > Good luck,  D
> >
> > > On Mar 21, 1:42 pm, Richard Vézina 
> > > wrote:
> > > > Hello Mart,
> >
> > > > I need to generate WordML out of web2py... Is there a "easier" or
> more
> > > > integrated way then use xslt transformation that is the easiest way
> that
> > > > comes to my mind?
> >
> > > > Thanks
> >
> > > > Richard
> >
> > > > On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > > > > I use lots of XML to drive automation, file system structure,
> > > > > validation, user initial input, etc, so pretty much everywhere I
> make
> > > > > use of xml. much of the data (that may be user or project specific)
> is
> > > > > submitted as XML, then use that to populate tables (which BTW - I
> > > > > found lately to be a great way to share data between module
> [something
> > > > > that looks like a properties object]). I also frequently generate
> and/
> > > > > or convert chunks of xml to dictionary objects (wrapper to make a
> > > > > dictionary behave like an object - looks like web2py's storage) so
> I
> > > > > can run through data by doing a.b.c.d (which I find very useful at
> > > > > times). These are some of the ways where I use xml on daily basis.
> >
> > > > > So my use of it in a web2py context goes more towards DAL
> stand-alone
> > > > > than in a 'over the web' context, but you're welcome to anything I
> > > > > have if interested. I have lots of code and can probably make
> samples
> > > > > depending on what you need, - I mostly stick to etree (maybe just a
> > > > > preference), because I like that I can reset .root anywhere i like
> and
> > > > > can easily group similar items).
> >
> > > > > Mart :)
> >
> > > > > On Mar 20, 3:58 pm, villas  wrote:
> > > > > > OK I found a way (it was of course easier than I thought!).
> > > > > > However, if anyone has any interesting XML resources/tips,  I
> would
> > > > > > still be interested to learn more.
> > > > > > Thanks!
> >
> >
>


Re: [web2py] Re: XML manipulation

2011-03-21 Thread Richard Vézina
That's a brillant idea...

I check about it tomorrow.

Thanks

Richard

On Mon, Mar 21, 2011 at 5:05 PM, mart  wrote:

> Hi Richard,
>
> Yeah, I hate transforms too :( I haven't really worked with wordml,
> but... it all looks the same to me... I would definitely take the
> dictionary approach, should be fairly simple. If you like i can grap a
> web2py table, convert it to xml (that is how you are getting you
> xml?), then write a quick script to wrap code I already have that
> would probably do the job almost as is (i tend to automate pretty much
> everything work related) so i make things as reusable as possible ...,
> then you can simply drop it in a controller or in /modules (or use as
> is) and re-use any time you like. I'm sure we can get a decent wordml
> reference table on the Net somewhere. Let me know if that's what
> you're looking for and I can probably get it done tonight.
>
> Mart :)
>
> On Mar 21, 1:25 pm, Richard Vézina 
> wrote:
> > It is not bad for start... But what happen when you change your query in
> > term of number of columns or rows? Do you have to make an other template
> > each time... Personnaly I don't like xml that much, so I don't want to
> have
> > to get back at editing my template all the time.
> >
> > Richard
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Mar 21, 2011 at 1:19 PM, villas  wrote:
> > > Hi Richard
> >
> > > As a novice, the easiest solution I found was something like this:
> >
> > > * create wordml.xml template in views/default/ folder
> > > * prepare the xml, place variables for the data
> > > * create a wordml function in controller
> > > * manipulate your data into the variables in the controller ready to
> > > place in the template
> > > * call the function with url wordml.xls
> >
> > > This is adequate for me,  but may be too simple for your case. Mart
> > > may have something better, but 'simple' is about my limit, and I
> > > already lost almost a day studying other methods :-)
> >
> > > Good luck,  D
> >
> > > On Mar 21, 1:42 pm, Richard Vézina 
> > > wrote:
> > > > Hello Mart,
> >
> > > > I need to generate WordML out of web2py... Is there a "easier" or
> more
> > > > integrated way then use xslt transformation that is the easiest way
> that
> > > > comes to my mind?
> >
> > > > Thanks
> >
> > > > Richard
> >
> > > > On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > > > > I use lots of XML to drive automation, file system structure,
> > > > > validation, user initial input, etc, so pretty much everywhere I
> make
> > > > > use of xml. much of the data (that may be user or project specific)
> is
> > > > > submitted as XML, then use that to populate tables (which BTW - I
> > > > > found lately to be a great way to share data between module
> [something
> > > > > that looks like a properties object]). I also frequently generate
> and/
> > > > > or convert chunks of xml to dictionary objects (wrapper to make a
> > > > > dictionary behave like an object - looks like web2py's storage) so
> I
> > > > > can run through data by doing a.b.c.d (which I find very useful at
> > > > > times). These are some of the ways where I use xml on daily basis.
> >
> > > > > So my use of it in a web2py context goes more towards DAL
> stand-alone
> > > > > than in a 'over the web' context, but you're welcome to anything I
> > > > > have if interested. I have lots of code and can probably make
> samples
> > > > > depending on what you need, - I mostly stick to etree (maybe just a
> > > > > preference), because I like that I can reset .root anywhere i like
> and
> > > > > can easily group similar items).
> >
> > > > > Mart :)
> >
> > > > > On Mar 20, 3:58 pm, villas  wrote:
> > > > > > OK I found a way (it was of course easier than I thought!).
> > > > > > However, if anyone has any interesting XML resources/tips,  I
> would
> > > > > > still be interested to learn more.
> > > > > > Thanks!
>


[web2py] Re: XML manipulation

2011-03-21 Thread villas
Hi Richard,

In my case I was making the XML fit a specification given to me by
someone else. It isn't very flexible to change it,  but I doubt that
the specification will be changing much either.

It is a pity there isn't a Zen of XML saying there should ideally be
just one obvious way of doing something. During my hours of research I
had so many ideas that I had to go and take an aspirin!

-D


On Mar 21, 5:25 pm, Richard Vézina 
wrote:
> It is not bad for start... But what happen when you change your query in
> term of number of columns or rows? Do you have to make an other template
> each time... Personnaly I don't like xml that much, so I don't want to have
> to get back at editing my template all the time.
>
> Richard
>
> On Mon, Mar 21, 2011 at 1:19 PM, villas  wrote:
> > Hi Richard
>
> > As a novice, the easiest solution I found was something like this:
>
> > * create wordml.xml template in views/default/ folder
> > * prepare the xml, place variables for the data
> > * create a wordml function in controller
> > * manipulate your data into the variables in the controller ready to
> > place in the template
> > * call the function with url wordml.xls
>
> > This is adequate for me,  but may be too simple for your case. Mart
> > may have something better, but 'simple' is about my limit, and I
> > already lost almost a day studying other methods :-)
>
> > Good luck,  D
>
> > On Mar 21, 1:42 pm, Richard Vézina 
> > wrote:
> > > Hello Mart,
>
> > > I need to generate WordML out of web2py... Is there a "easier" or more
> > > integrated way then use xslt transformation that is the easiest way that
> > > comes to my mind?
>
> > > Thanks
>
> > > Richard
>
> > > On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > > > I use lots of XML to drive automation, file system structure,
> > > > validation, user initial input, etc, so pretty much everywhere I make
> > > > use of xml. much of the data (that may be user or project specific) is
> > > > submitted as XML, then use that to populate tables (which BTW - I
> > > > found lately to be a great way to share data between module [something
> > > > that looks like a properties object]). I also frequently generate and/
> > > > or convert chunks of xml to dictionary objects (wrapper to make a
> > > > dictionary behave like an object - looks like web2py's storage) so I
> > > > can run through data by doing a.b.c.d (which I find very useful at
> > > > times). These are some of the ways where I use xml on daily basis.
>
> > > > So my use of it in a web2py context goes more towards DAL stand-alone
> > > > than in a 'over the web' context, but you're welcome to anything I
> > > > have if interested. I have lots of code and can probably make samples
> > > > depending on what you need, - I mostly stick to etree (maybe just a
> > > > preference), because I like that I can reset .root anywhere i like and
> > > > can easily group similar items).
>
> > > > Mart :)
>
> > > > On Mar 20, 3:58 pm, villas  wrote:
> > > > > OK I found a way (it was of course easier than I thought!).
> > > > > However, if anyone has any interesting XML resources/tips,  I would
> > > > > still be interested to learn more.
> > > > > Thanks!
>
>


[web2py] Re: XML manipulation

2011-03-21 Thread mart
Hi Richard,

Yeah, I hate transforms too :( I haven't really worked with wordml,
but... it all looks the same to me... I would definitely take the
dictionary approach, should be fairly simple. If you like i can grap a
web2py table, convert it to xml (that is how you are getting you
xml?), then write a quick script to wrap code I already have that
would probably do the job almost as is (i tend to automate pretty much
everything work related) so i make things as reusable as possible ...,
then you can simply drop it in a controller or in /modules (or use as
is) and re-use any time you like. I'm sure we can get a decent wordml
reference table on the Net somewhere. Let me know if that's what
you're looking for and I can probably get it done tonight.

Mart :)

On Mar 21, 1:25 pm, Richard Vézina 
wrote:
> It is not bad for start... But what happen when you change your query in
> term of number of columns or rows? Do you have to make an other template
> each time... Personnaly I don't like xml that much, so I don't want to have
> to get back at editing my template all the time.
>
> Richard
>
>
>
>
>
>
>
> On Mon, Mar 21, 2011 at 1:19 PM, villas  wrote:
> > Hi Richard
>
> > As a novice, the easiest solution I found was something like this:
>
> > * create wordml.xml template in views/default/ folder
> > * prepare the xml, place variables for the data
> > * create a wordml function in controller
> > * manipulate your data into the variables in the controller ready to
> > place in the template
> > * call the function with url wordml.xls
>
> > This is adequate for me,  but may be too simple for your case. Mart
> > may have something better, but 'simple' is about my limit, and I
> > already lost almost a day studying other methods :-)
>
> > Good luck,  D
>
> > On Mar 21, 1:42 pm, Richard Vézina 
> > wrote:
> > > Hello Mart,
>
> > > I need to generate WordML out of web2py... Is there a "easier" or more
> > > integrated way then use xslt transformation that is the easiest way that
> > > comes to my mind?
>
> > > Thanks
>
> > > Richard
>
> > > On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > > > I use lots of XML to drive automation, file system structure,
> > > > validation, user initial input, etc, so pretty much everywhere I make
> > > > use of xml. much of the data (that may be user or project specific) is
> > > > submitted as XML, then use that to populate tables (which BTW - I
> > > > found lately to be a great way to share data between module [something
> > > > that looks like a properties object]). I also frequently generate and/
> > > > or convert chunks of xml to dictionary objects (wrapper to make a
> > > > dictionary behave like an object - looks like web2py's storage) so I
> > > > can run through data by doing a.b.c.d (which I find very useful at
> > > > times). These are some of the ways where I use xml on daily basis.
>
> > > > So my use of it in a web2py context goes more towards DAL stand-alone
> > > > than in a 'over the web' context, but you're welcome to anything I
> > > > have if interested. I have lots of code and can probably make samples
> > > > depending on what you need, - I mostly stick to etree (maybe just a
> > > > preference), because I like that I can reset .root anywhere i like and
> > > > can easily group similar items).
>
> > > > Mart :)
>
> > > > On Mar 20, 3:58 pm, villas  wrote:
> > > > > OK I found a way (it was of course easier than I thought!).
> > > > > However, if anyone has any interesting XML resources/tips,  I would
> > > > > still be interested to learn more.
> > > > > Thanks!


Re: [web2py] Re: XML manipulation

2011-03-21 Thread Richard Vézina
It is not bad for start... But what happen when you change your query in
term of number of columns or rows? Do you have to make an other template
each time... Personnaly I don't like xml that much, so I don't want to have
to get back at editing my template all the time.

Richard

On Mon, Mar 21, 2011 at 1:19 PM, villas  wrote:

> Hi Richard
>
> As a novice, the easiest solution I found was something like this:
>
> * create wordml.xml template in views/default/ folder
> * prepare the xml, place variables for the data
> * create a wordml function in controller
> * manipulate your data into the variables in the controller ready to
> place in the template
> * call the function with url wordml.xls
>
> This is adequate for me,  but may be too simple for your case. Mart
> may have something better, but 'simple' is about my limit, and I
> already lost almost a day studying other methods :-)
>
> Good luck,  D
>
> On Mar 21, 1:42 pm, Richard Vézina 
> wrote:
> > Hello Mart,
> >
> > I need to generate WordML out of web2py... Is there a "easier" or more
> > integrated way then use xslt transformation that is the easiest way that
> > comes to my mind?
> >
> > Thanks
> >
> > Richard
> >
> > On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > > I use lots of XML to drive automation, file system structure,
> > > validation, user initial input, etc, so pretty much everywhere I make
> > > use of xml. much of the data (that may be user or project specific) is
> > > submitted as XML, then use that to populate tables (which BTW - I
> > > found lately to be a great way to share data between module [something
> > > that looks like a properties object]). I also frequently generate and/
> > > or convert chunks of xml to dictionary objects (wrapper to make a
> > > dictionary behave like an object - looks like web2py's storage) so I
> > > can run through data by doing a.b.c.d (which I find very useful at
> > > times). These are some of the ways where I use xml on daily basis.
> >
> > > So my use of it in a web2py context goes more towards DAL stand-alone
> > > than in a 'over the web' context, but you're welcome to anything I
> > > have if interested. I have lots of code and can probably make samples
> > > depending on what you need, - I mostly stick to etree (maybe just a
> > > preference), because I like that I can reset .root anywhere i like and
> > > can easily group similar items).
> >
> > > Mart :)
> >
> > > On Mar 20, 3:58 pm, villas  wrote:
> > > > OK I found a way (it was of course easier than I thought!).
> > > > However, if anyone has any interesting XML resources/tips,  I would
> > > > still be interested to learn more.
> > > > Thanks!
> >
> >
>


[web2py] Re: XML manipulation

2011-03-21 Thread villas
Hi Richard

As a novice, the easiest solution I found was something like this:

* create wordml.xml template in views/default/ folder
* prepare the xml, place variables for the data
* create a wordml function in controller
* manipulate your data into the variables in the controller ready to
place in the template
* call the function with url wordml.xls

This is adequate for me,  but may be too simple for your case. Mart
may have something better, but 'simple' is about my limit, and I
already lost almost a day studying other methods :-)

Good luck,  D

On Mar 21, 1:42 pm, Richard Vézina 
wrote:
> Hello Mart,
>
> I need to generate WordML out of web2py... Is there a "easier" or more
> integrated way then use xslt transformation that is the easiest way that
> comes to my mind?
>
> Thanks
>
> Richard
>
> On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:
> > I use lots of XML to drive automation, file system structure,
> > validation, user initial input, etc, so pretty much everywhere I make
> > use of xml. much of the data (that may be user or project specific) is
> > submitted as XML, then use that to populate tables (which BTW - I
> > found lately to be a great way to share data between module [something
> > that looks like a properties object]). I also frequently generate and/
> > or convert chunks of xml to dictionary objects (wrapper to make a
> > dictionary behave like an object - looks like web2py's storage) so I
> > can run through data by doing a.b.c.d (which I find very useful at
> > times). These are some of the ways where I use xml on daily basis.
>
> > So my use of it in a web2py context goes more towards DAL stand-alone
> > than in a 'over the web' context, but you're welcome to anything I
> > have if interested. I have lots of code and can probably make samples
> > depending on what you need, - I mostly stick to etree (maybe just a
> > preference), because I like that I can reset .root anywhere i like and
> > can easily group similar items).
>
> > Mart :)
>
> > On Mar 20, 3:58 pm, villas  wrote:
> > > OK I found a way (it was of course easier than I thought!).
> > > However, if anyone has any interesting XML resources/tips,  I would
> > > still be interested to learn more.
> > > Thanks!
>
>


Re: [web2py] Re: XML manipulation

2011-03-21 Thread Richard Vézina
Hello Mart,

I need to generate WordML out of web2py... Is there a "easier" or more
integrated way then use xslt transformation that is the easiest way that
comes to my mind?

Thanks

Richard

On Sun, Mar 20, 2011 at 8:20 PM, mart  wrote:

> I use lots of XML to drive automation, file system structure,
> validation, user initial input, etc, so pretty much everywhere I make
> use of xml. much of the data (that may be user or project specific) is
> submitted as XML, then use that to populate tables (which BTW - I
> found lately to be a great way to share data between module [something
> that looks like a properties object]). I also frequently generate and/
> or convert chunks of xml to dictionary objects (wrapper to make a
> dictionary behave like an object - looks like web2py's storage) so I
> can run through data by doing a.b.c.d (which I find very useful at
> times). These are some of the ways where I use xml on daily basis.
>
> So my use of it in a web2py context goes more towards DAL stand-alone
> than in a 'over the web' context, but you're welcome to anything I
> have if interested. I have lots of code and can probably make samples
> depending on what you need, - I mostly stick to etree (maybe just a
> preference), because I like that I can reset .root anywhere i like and
> can easily group similar items).
>
> Mart :)
>
>
> On Mar 20, 3:58 pm, villas  wrote:
> > OK I found a way (it was of course easier than I thought!).
> > However, if anyone has any interesting XML resources/tips,  I would
> > still be interested to learn more.
> > Thanks!
>


[web2py] Re: XML manipulation

2011-03-20 Thread mart
Agreed, often best to wait, take a step back and eventually we trip
and fall on our own answers ;)

On Mar 20, 8:57 pm, villas  wrote:
> Thanks Mart, that's really kind!  To cut a long story short, I
> eventually figured out that I don't need to manipulate any XML itself
> at this stage, I can manipulate everything first and just render it at
> the end.
>
> I've wasted so much time messing around, so if it gets complicated for
> me again,  I'll come and ask!  Sometimes the obvious is the most
> elusive!
> Best wishes,
> -D


[web2py] Re: XML manipulation

2011-03-20 Thread villas
Thanks Mart, that's really kind!  To cut a long story short, I
eventually figured out that I don't need to manipulate any XML itself
at this stage, I can manipulate everything first and just render it at
the end.

I've wasted so much time messing around, so if it gets complicated for
me again,  I'll come and ask!  Sometimes the obvious is the most
elusive!
Best wishes,
-D


[web2py] Re: XML manipulation

2011-03-20 Thread mart
I use lots of XML to drive automation, file system structure,
validation, user initial input, etc, so pretty much everywhere I make
use of xml. much of the data (that may be user or project specific) is
submitted as XML, then use that to populate tables (which BTW - I
found lately to be a great way to share data between module [something
that looks like a properties object]). I also frequently generate and/
or convert chunks of xml to dictionary objects (wrapper to make a
dictionary behave like an object - looks like web2py's storage) so I
can run through data by doing a.b.c.d (which I find very useful at
times). These are some of the ways where I use xml on daily basis.

So my use of it in a web2py context goes more towards DAL stand-alone
than in a 'over the web' context, but you're welcome to anything I
have if interested. I have lots of code and can probably make samples
depending on what you need, - I mostly stick to etree (maybe just a
preference), because I like that I can reset .root anywhere i like and
can easily group similar items).

Mart :)


On Mar 20, 3:58 pm, villas  wrote:
> OK I found a way (it was of course easier than I thought!).
> However, if anyone has any interesting XML resources/tips,  I would
> still be interested to learn more.
> Thanks!


[web2py] Re: XML manipulation

2011-03-20 Thread villas
OK I found a way (it was of course easier than I thought!).
However, if anyone has any interesting XML resources/tips,  I would
still be interested to learn more.
Thanks!