cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Messing, Elad" <>
Subject JXTemplate, Xpath and Namespace
Date Tue, 12 Apr 2005 10:36:59 GMT
Hello all
	I have a newbie question related to Xpath expression and
	Here goes :
	I have an XHTML page. It looks like this :

<?xml version="1.0" encoding="ISO-8859-7"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns:bla="http://bla"
		<meta http-equiv="Content-Style-Type" content="text/css"

	Then I pass it through the JXTemplate generator, which changes
it to the xml that look like this :

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns:bla="http://bla"
		<meta http-equiv="Content-Style-Type"

	As you see, the default namespace
was added to the html declaration. Now - when I try to match 	a
template in this xml document - I.E. " //head " the Xpath doesn't find
the node - because it is actually connected 	to the default
namespace, and Xpath will not return the <head> element. I think that
for Xpath there is no such 	thing as default namespace.

	I know I can use the Xpath expression with *[1] and etc to reach
the desired node- but this is not very elegant.

	So my question is - What should be done in this case ?
	Should I have the JXTemplate generator to not add the defualt
namespace ? How ?
	Or maybe this is not the right direction ?


Elad Messing

View raw message