Developer Question [DOMDocument]
Developer Question [DOMDocument]
am 05.10.2009 10:45:03 von Michael Peters
I'm hoping someone who knows the answer to this question is on this list.
I need to modify either libxml2 and/or php DOMDocument to make a small
change.
Issue - saveHTML() function predates html5 (which isn't even finalized
yet) and thus does not know about it's tags.
the source element is new in html5 and may not have any children, so
when using saveHTML() from DOMDocument, it should NOT add a closing
tag (it should be handled the same way the param element is
handled). It does the right thing with saveXML() where it properly self
closes the tag, but it does not do the right thing with saveHTML().
I suspect it is a minor easy to do change, but I don't even have the
foggiest idea where to look in the source to make a patch.
It's not all that big of a deal, but I would like my server to spit out
the correct code without me having to pass it through preg_replace.
Thanks for any suggestions on where/how to define that tag in the source.
Michael A. Peters
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
RE: Developer Question [DOMDocument]
am 05.10.2009 11:49:52 von Andrea Giammarchi
--_0f0ba364-7372-406a-a767-cd14fd5d7e3b_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
saveXML and transform it via XSL
It should be simple since basically the only thing you have to do is to rep=
licate everything adding right at the beginning and nothing=
else.
Is this solution suitable for your requirements?
Regards
> Date: Mon=2C 5 Oct 2009 01:45:03 -0700
> From: mpeters@mac.com
> To: php-general@lists.php.net
> Subject: [PHP] Developer Question [DOMDocument]
>=20
> I'm hoping someone who knows the answer to this question is on this list.
>=20
> I need to modify either libxml2 and/or php DOMDocument to make a small=20
> change.
>=20
> Issue - saveHTML() function predates html5 (which isn't even finalized=20
> yet) and thus does not know about it's tags.
>=20
> the source element is new in html5 and may not have any children=2C so=20
> when using saveHTML() from DOMDocument=2C it should NOT add a closing=20
> tag (it should be handled the same way the param element is=20
> handled). It does the right thing with saveXML() where it properly self=20
> closes the tag=2C but it does not do the right thing with saveHTML().
>=20
> I suspect it is a minor easy to do change=2C but I don't even have the=20
> foggiest idea where to look in the source to make a patch.
>=20
> It's not all that big of a deal=2C but I would like my server to spit out=
=20
> the correct code without me having to pass it through preg_replace.
>=20
> Thanks for any suggestions on where/how to define that tag in the source.
>=20
> Michael A. Peters
>=20
> --=20
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe=2C visit: http://www.php.net/unsub.php
>=20
=0A=
____________________________________________________________ _____=0A=
Windows Live: Make it easier for your friends to see what you=92re up to on=
Facebook.=0A=
http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en -xm:SI_SB_2:092=
009=
--_0f0ba364-7372-406a-a767-cd14fd5d7e3b_--
Re: Developer Question [DOMDocument]
am 05.10.2009 11:53:53 von Ashley Sheridan
--=-TMndbPqSVpzmy2cpWnX0
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
On Mon, 2009-10-05 at 01:45 -0700, Michael A. Peters wrote:
> I'm hoping someone who knows the answer to this question is on this list.
>
> I need to modify either libxml2 and/or php DOMDocument to make a small
> change.
>
> Issue - saveHTML() function predates html5 (which isn't even finalized
> yet) and thus does not know about it's tags.
>
> the source element is new in html5 and may not have any children, so
> when using saveHTML() from DOMDocument, it should NOT add a closing
> tag (it should be handled the same way the param element is
> handled). It does the right thing with saveXML() where it properly self
> closes the tag, but it does not do the right thing with saveHTML().
>
> I suspect it is a minor easy to do change, but I don't even have the
> foggiest idea where to look in the source to make a patch.
>
> It's not all that big of a deal, but I would like my server to spit out
> the correct code without me having to pass it through preg_replace.
>
> Thanks for any suggestions on where/how to define that tag in the source.
>
> Michael A. Peters
>
I've not had a look at DOMDocument myself, having only used DomDocument
before (there's a slight difference in the capitalisation of the 2nd and
3rd letters which made it a pain in the proverbial to work with at
first!) but I would assume that if it might offer a method by which you
could specify certain self closing tags. This would be necessary at
least internally, to differentiate between things like which
can be self closing and .
>
> If not, then I'd do a file find on the code for any files containing the
> text 'param' for example, to see if that leads you to the right place.
I tried that on libxml2 source - grep -R "param" didn't work so well, a
bazillion files with that use the phrase "param".
>
> You may have problems doing this on a Windows XP system,
I'm on linux.
I'll find it eventually. Probably just before upstream does an official
html5 patch ;)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Developer Question [DOMDocument]
am 05.10.2009 12:14:23 von Michael Peters
Michael A. Peters wrote:
> Ashley Sheridan wrote:
>
>>>
>> I've not had a look at DOMDocument myself, having only used
>> DomDocument before (there's a slight difference in the capitalisation
>> of the 2nd and 3rd letters which made it a pain in the proverbial to
>> work with at first!) but I would assume that if it might offer a
>> method by which you could specify certain self closing tags. This
>> would be necessary at least internally, to differentiate between
>> things like which can be self closing and .
Doh!
I was thing meta, script does self close as saveXML() w/ no children but
does do with saveHTML().
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Developer Question [DOMDocument]
am 05.10.2009 13:36:18 von Lupus Michaelis
Ashley Sheridan wrote:
>
> I've not had a look at DOMDocument myself, having only used DomDocument
> before (there's a slight difference in the capitalisation of the 2nd and
> 3rd letters which made it a pain in the proverbial to work with at
> first!)
Did you never notice that PHP has case insensitive class names and
function names ? (maybe you did a joke ?)
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Developer Question [DOMDocument]
am 05.10.2009 13:48:30 von Ashley Sheridan
--=-jh6IiogLjxnc16tpKnJC
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Mon, 2009-10-05 at 13:36 +0200, Lupus Michaelis wrote:
> Ashley Sheridan wrote:
> >=20
> > I've not had a look at DOMDocument myself, having only used DomDocument
> > before (there's a slight difference in the capitalisation of the 2nd an=
d
> > 3rd letters which made it a pain in the proverbial to work with at
> > first!)
>=20
> Did you never notice that PHP has case insensitive class names and=20
> function names ? (maybe you did a joke ?)
>=20
> --=20
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org
>=20
No joke, look it up yourself. DOMDocument is different from DomDocument
(the latter is pre PHP 5) I had a lot of issues looking up for help on
this, as search engines aren't case-sensitive!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-jh6IiogLjxnc16tpKnJC--
RE: Developer Question [DOMDocument]
am 05.10.2009 13:59:43 von Andrea Giammarchi
--_24bf2e56-fc8a-415e-9257-3a3e505e9649_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
> search engines aren't case-sensitive!
... try to search php.net or PHP.NET in Google and you'll obtain exactly t=
he same result ... in PHP strtolower and strToLower are exactly the same=2C=
as the same is DomDocument=2C DOMDocument=2C or DOMDOCUMENT=2C at least in=
PHP 5.3
If you used an early version (PECL) of the DomDocument it's another story b=
ut please change opinion about case sensitive searches or classes ...=20
Regards
=0A=
____________________________________________________________ _____=0A=
Windows Live: Make it easier for your friends to see what you=92re up to on=
Facebook.=0A=
http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en -xm:SI_SB_2:092=
009=
--_24bf2e56-fc8a-415e-9257-3a3e505e9649_--
RE: Developer Question [DOMDocument]
am 05.10.2009 14:01:32 von Andrea Giammarchi
--_6b8f3b10-245a-4c65-860b-499b5bb08755_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
My apologies I read search engines ARE case sensitive ... never mind=2C sti=
ll DomDocument and DOMDocument are the same.
Regards=20
> From: an_red@hotmail.com
> To: ash@ashleysheridan.co.uk=3B mickael+php@lupusmic.org
> CC: php-general@lists.php.net
> Date: Mon=2C 5 Oct 2009 13:59:43 +0200
> Subject: RE: [PHP] Developer Question [DOMDocument]
>=20
>=20
>=20
> > search engines aren't case-sensitive!
>=20
> ... try to search php.net or PHP.NET in Google and you'll obtain exactly=
the same result ... in PHP strtolower and strToLower are exactly the same=
=2C as the same is DomDocument=2C DOMDocument=2C or DOMDOCUMENT=2C at least=
in PHP 5.3
>=20
> If you used an early version (PECL) of the DomDocument it's another story=
but please change opinion about case sensitive searches or classes ...=20
>=20
> Regards
> =20
> ____________________________________________________________ _____
> Windows Live: Make it easier for your friends to see what you=92re up to =
on Facebook.
> http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/=
social-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL: en-xm:SI_SB_2:0=
92009
=0A=
____________________________________________________________ _____=0A=
Windows Live: Friends get your Flickr=2C Yelp=2C and Digg updates when they=
e-mail you.=0A=
http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en -xm:SI_SB_3:092=
010=
--_6b8f3b10-245a-4c65-860b-499b5bb08755_--
RE: Developer Question [DOMDocument]
am 05.10.2009 14:11:12 von Ashley Sheridan
--=-m+j8wV4kygiMXfGBAHC1
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Mon, 2009-10-05 at 13:59 +0200, Andrea Giammarchi wrote:
>=20
> > search engines aren't case-sensitive!
>=20
> ... try to search php.net or PHP.NET in Google and you'll obtain exactly=
the same result ... in PHP strtolower and strToLower are exactly the same,=
as the same is DomDocument, DOMDocument, or DOMDOCUMENT, at least in PHP 5=
..3
>=20
> If you used an early version (PECL) of the DomDocument it's another story=
but please change opinion about case sensitive searches or classes ...=20
>=20
> Regards
> =20
> ____________________________________________________________ _____
> Windows Live: Make it easier for your friends to see what youâ=99re =
up to on Facebook.
> http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/=
social-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL: en-xm:SI_SB_2:0=
92009
I never tried to say that classes are case-sensitive, that was actually
mentioned by Lupus who misunderstood what I was trying to say. What I
was meaning is exactly what you just said here, that the PECL
DomDocument is very different from the more typical DOMDocument. I was
trying to run code examples that just weren't compatible with the
differing classes which was quite frustrating!
Thanks,
Ash
http://www.ashleysheridan.co.uk
--=-m+j8wV4kygiMXfGBAHC1--
RE: Developer Question [DOMDocument]
am 05.10.2009 14:29:55 von Andrea Giammarchi
--_1ee8f773-8902-4570-9feb-760a0fc574fc_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
Yeah=2C if it can make you feel better=2C you are not the only one with som=
e PECL habit=2C lazily introduced in PHP as core feature changing almost ev=
erything.
Regards
> From: ash@ashleysheridan.co.uk
> To: an_red@hotmail.com
> CC: mickael+php@lupusmic.org=3B php-general@lists.php.net
> Date: Mon=2C 5 Oct 2009 13:11:12 +0100
> Subject: RE: [PHP] Developer Question [DOMDocument]
>=20
> On Mon=2C 2009-10-05 at 13:59 +0200=2C Andrea Giammarchi wrote:
>=20
> >=20
> > > search engines aren't case-sensitive!
> >=20
> > ... try to search php.net or PHP.NET in Google and you'll obtain exact=
ly the same result ... in PHP strtolower and strToLower are exactly the sam=
e=2C as the same is DomDocument=2C DOMDocument=2C or DOMDOCUMENT=2C at leas=
t in PHP 5.3
> >=20
> > If you used an early version (PECL) of the DomDocument it's another sto=
ry but please change opinion about case sensitive searches or classes ...=20
> >=20
> > Regards
> > =20
> > ____________________________________________________________ _____
> > Windows Live: Make it easier for your friends to see what you=92re up t=
o on Facebook.
> > http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-actio=
n/social-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:W L:en-xm:SI_SB_2=
:092009
>=20
>=20
> I never tried to say that classes are case-sensitive=2C that was actually
> mentioned by Lupus who misunderstood what I was trying to say. What I
> was meaning is exactly what you just said here=2C that the PECL
> DomDocument is very different from the more typical DOMDocument. I was
> trying to run code examples that just weren't compatible with the
> differing classes which was quite frustrating!
>=20
> Thanks=2C
> Ash
> http://www.ashleysheridan.co.uk
>=20
>=20
=0A=
____________________________________________________________ _____=0A=
Windows Live: Make it easier for your friends to see what you=92re up to on=
Facebook.=0A=
http://www.microsoft.com/middleeast/windows/windowslive/see- it-in-action/so=
cial-network-basics.aspx?ocid=3DPID23461::T:WLMTAGL:ON:WL:en -xm:SI_SB_2:092=
009=
--_1ee8f773-8902-4570-9feb-760a0fc574fc_--
Re: Developer Question [DOMDocument]
am 05.10.2009 19:17:21 von Michael Peters
Ashley Sheridan wrote:
>
>
> I never tried to say that classes are case-sensitive, that was
> actually mentioned by Lupus who misunderstood what I was trying to
> say. What I was meaning is exactly what you just said here, that the
> PECL DomDocument is very different from the more typical DOMDocument.
> I was trying to run code examples that just weren't compatible with
> the differing classes which was quite frustrating!
Yes - I found instructions that just don't work that were for what I
thought was an older version of it, I didn't know the previous version
was PECL.
Interestingly, it's often not too hard to figure out how to do things in
php DOMDocument from tutorials written for the Java implementation.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php