You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axkit-dev@xml.apache.org by Kip Hampton <kh...@totalcinema.com> on 2003/02/17 04:08:25 UTC

RFC: 1.7 Feature -- Add get_dom() to Providers

Howdy AxHackers,

Feature:
Add a get_dom() method to the Providers to allow custom Provider authors 
to pass in an XML::LibXML DOM document instance.

Justification:
Currently, application-based Provider authors must either:

1) incur the major overhead of calling toString() on their DOMs and 
returning it via get_strref() to let AxKit reparse it, or

2) brute-force the DOM into pnotes->('dom_tree'), which means that the 
root, DTD, and stylesheet PIs are not properly evaluated against 
AxAdd*Processor rules.

Adding get_dom() would cover both cases, and breaks no existing 
functionality. The only real downside is that get_styles() will need to 
get a bit more complex to cover the non-textual-XML case.

Thoughts?

-kip


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Jörg Walter <eh...@ich.bin.kein.hoschi.de>.
On Monday, 17. February 2003 23:04, Kip Hampton wrote:
> Matt Sergeant wrote:
>  > Or are you saying
> >
> > the other way around - provide a default get_dom() that works on top of
> > the current get_fh() and get_strref() implementations? That makes a lot
> > of sense to me.
>
> Right, he means just a wrapper over get_strref() and get_fh() that
> DOM-returning subclasses could also override, as needed. At least, I
> think that's what he meant... that's what I was +1'ing, anyway :-)

Yeah, exactly. That's what I meant.

-- 
CU
  Joerg

PGP Public Key at http://ich.bin.kein.hoschi.de/~trouble/public_key.asc
PGP Key fingerprint = D34F 57C4 99D8 8F16 E16E  7779 CDDC 41A4 4C48 6F94


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Kip Hampton <kh...@totalcinema.com>.
Matt Sergeant wrote:
 > Or are you saying
> the other way around - provide a default get_dom() that works on top of 
> the current get_fh() and get_strref() implementations? That makes a lot 
> of sense to me.

Right, he means just a wrapper over get_strref() and get_fh() that 
DOM-returning subclasses could also override, as needed. At least, I 
think that's what he meant... that's what I was +1'ing, anyway :-)

-kip


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Matt Sergeant <ma...@sergeant.org>.
On Monday, Feb 17, 2003, at 17:21 Europe/London, Jörg Walter wrote:

> We don't prevent them doing it their way. But fact is that most, if 
> not all,
> current language modules just parse the DOM exactly like LibXSLT.pm 
> does it.
> What those really need is just a simple "sub get_dom". By putting the 
> code
> into Provider.pm, every provider gets a decent get_dom and we can 
> remove the
> current mess from most lanuguage modules.

Maybe I'm confused as to what you're suggesting then... I thought you 
were suggesting we get rid of get_fh and get_strref? If not, then I 
don't see how it rids LibXSLT.pm of the mess it has. Or are you saying 
the other way around - provide a default get_dom() that works on top of 
the current get_fh() and get_strref() implementations? That makes a lot 
of sense to me.

Matt.


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Jörg Walter <eh...@ich.bin.kein.hoschi.de>.
On Monday, 17. February 2003 14:37, you wrote:

> > >> Look at LibXSLT.pm for example - the code used to parse the XML is
> > >> used all over AxKit in several places. We should either let get dom do
> > >> that work (parsing the FH or strref if neccessary), and let all others
> > >> only call get dom instead of trying several methods, or provide other
> > >> helper methods in case get dom is not able to exactly replace the
> > >> current code.
> > >
> > > Brilliant idea! +1 from me.
> >
> > +1 here, too. A lot less messy that way.
>
> Aren't we implying that things always then have to be in memory? That was
> the idea behind get fh() in the first place - some Language modules or
> other parts of axkit might be happier with a filehandle than a DOM or
> string.

We don't prevent them doing it their way. But fact is that most, if not all, 
current language modules just parse the DOM exactly like LibXSLT.pm does it. 
What those really need is just a simple "sub get_dom". By putting the code 
into Provider.pm, every provider gets a decent get_dom and we can remove the 
current mess from most lanuguage modules.

-- 
CU
  Joerg

PGP Public Key at http://ich.bin.kein.hoschi.de/~trouble/public_key.asc
PGP Key fingerprint = D34F 57C4 99D8 8F16 E16E  7779 CDDC 41A4 4C48 6F94


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Matt Sergeant <ma...@sergeant.org>.
On Mon, 17 Feb 2003, Kip Hampton wrote:

> Robin Berjon wrote:
> > Jörg Walter wrote:
> >
> >> On Monday, 17. February 2003 04:08, Kip Hampton wrote:
> >>
> >>> Feature:
> >>> Add a get_dom() method to the Providers to allow custom Provider authors
> >>> to pass in an XML::LibXML DOM document instance.
> >>
> >>
> >> Look at LibXSLT.pm for example - the code used to parse the XML is
> >> used all over AxKit in several places. We should either let get_dom do
> >> that work (parsing the FH or strref if neccessary), and let all others
> >> only call get_dom instead of trying several methods, or provide other
> >> helper methods in case get_dom is not able to exactly replace the
> >> current code.
> >
> >
> > Brilliant idea! +1 from me.
>
> +1 here, too. A lot less messy that way.

Aren't we implying that things always then have to be in memory? That was
the idea behind get_fh() in the first place - some Language modules or
other parts of axkit might be happier with a filehandle than a DOM or
string.

Or am I missing something obvious?

-- 
<!-- Matt -->
<:->get a SMart net</:->
Spam trap - do not mail: spam-sig@spamtrap.messagelabs.com

Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Kip Hampton <kh...@totalcinema.com>.
Robin Berjon wrote:
> Jörg Walter wrote:
> 
>> On Monday, 17. February 2003 04:08, Kip Hampton wrote:
>>
>>> Feature:
>>> Add a get_dom() method to the Providers to allow custom Provider authors
>>> to pass in an XML::LibXML DOM document instance.
>>
>>
>> Look at LibXSLT.pm for example - the code used to parse the XML is 
>> used all over AxKit in several places. We should either let get_dom do 
>> that work (parsing the FH or strref if neccessary), and let all others 
>> only call get_dom instead of trying several methods, or provide other 
>> helper methods in case get_dom is not able to exactly replace the 
>> current code.
> 
> 
> Brilliant idea! +1 from me.

+1 here, too. A lot less messy that way.


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Robin Berjon <ro...@knowscape.com>.
Jörg Walter wrote:
> On Monday, 17. February 2003 04:08, Kip Hampton wrote:
>>Feature:
>>Add a get_dom() method to the Providers to allow custom Provider authors
>>to pass in an XML::LibXML DOM document instance.
> 
> Yes, +1 for that. But as that means we now have 3 ways of getting our XML, we 
> should make smart inheritance.
> Look at LibXSLT.pm for example - the code used to parse the XML is used all 
> over AxKit in several places. We should either let get_dom do that work 
> (parsing the FH or strref if neccessary), and let all others only call 
> get_dom instead of trying several methods, or provide other helper methods in 
> case get_dom is not able to exactly replace the current code.

Brilliant idea! +1 from me.

--r


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Jörg Walter <eh...@ich.bin.kein.hoschi.de>.
On Monday, 17. February 2003 04:08, Kip Hampton wrote:
> Howdy AxHackers,
>
> Feature:
> Add a get_dom() method to the Providers to allow custom Provider authors
> to pass in an XML::LibXML DOM document instance.

Yes, +1 for that. But as that means we now have 3 ways of getting our XML, we 
should make smart inheritance.
Look at LibXSLT.pm for example - the code used to parse the XML is used all 
over AxKit in several places. We should either let get_dom do that work 
(parsing the FH or strref if neccessary), and let all others only call 
get_dom instead of trying several methods, or provide other helper methods in 
case get_dom is not able to exactly replace the current code.

-- 
CU
  Joerg

PGP Public Key at http://ich.bin.kein.hoschi.de/~trouble/public_key.asc
PGP Key fingerprint = D34F 57C4 99D8 8F16 E16E  7779 CDDC 41A4 4C48 6F94


Re: RFC: 1.7 Feature -- Add get_dom() to Providers

Posted by Michael Kroell <mi...@uibk.ac.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sun, 16 Feb 2003, Kip Hampton wrote:

> Adding get_dom() would cover both cases, and breaks no existing 
> functionality. The only real downside is that get_styles() will need to 
> get a bit more complex to cover the non-textual-XML case.
> 
> Thoughts?

Great Idea! I know of at least two Apps who have been
eagerly waiting for this! ;-)

michael



-----BEGIN PGP SIGNATURE-----
Version: PGP 6.5.8

iQA/AwUBPlCj53jN0CNeKmaIEQKE0wCgsIxKVk852NtjClXDHU6Alp3LQfwAoJPf
CkoCqhizbLzkFyh7ACJGijGj
=C0GI
-----END PGP SIGNATURE-----