GravityPDF / querypath

A fork of QueryPath: a PHP library for HTML(5)/XML querying (CSS 4 or XPath) and processing (like jQuery) with PHP8.3 support
Other
21 stars 2 forks source link

Is it possible to use special characters in attribute when parsing? #15

Closed jakejackson1 closed 1 year ago

jakejackson1 commented 1 year ago

From querypath created by imsaeedafzal: technosophos/querypath#157

I have some custom tags for special purposes. I'm using special characters in attribute but QP does not allow me to use it. See html side example below;

< spml:each var="My_variable" idx="Index" in="{(0..< 5)}" hideOnLast="last"> < / spml:each>

I'm using qp() for parsing the html source. I also have tried with htmlqp() as well.
Can you please fix it? Or is there any workaround for this?

Thanks Smac

jakejackson1 commented 1 year ago

Is it the in attribute that's not working? What do you get back? I think it is probably the < that is causing problems because the XML and HTML specs both require that to be escaped.

jakejackson1 commented 1 year ago

Yes exactly that's the problem. Is there any solution for allowing these type of special characters in attributes?