We (me and another person in my office) were having some problems with
xi:include last week.  I, too, was asking the "Am I stupid, or is it time to
go home" question. Our xi:include was being seemingly ignored, and error
messages were not being logged.  We were able to finally get it to "work".
I was planning on posting some questions, comments, and observations when I
finished doing some research, but your message has prompted me to respond.


Assume the following directory with the following files:

/usr/local/apache/htdocs/test-site/xsp
        event.xsp    user_session.xsp

As one might guess, I have DocumentRoot set as /usr/local/apache/htdocs and
ServerRoot set as /usr/local/apache.

When I ran strace (similar to truss on some systems) on the httpd process
that was processing the xi:include contained in event.xsp I discovered
something that I have yet to explain.  If the href attribute was assigned a
relative filename (href="user_session.xsp") the xi:include had no apparent
effect and nothing helpful was logged.  The output of strace  indicated that
/usr/local/apache/htdocs/test-site/user_session.xsp (note the missing "xsp"
directory) was attempted to be accessed.  When I changed the attribute to
href="xsp/user_session.xsp" the xi:include began to function.  I would have
expected a relative href to be relative to the directory that contained
event.xsp, not its parent directory.

Is there is something wrong with my configuration that is causing this?  Why
wasn't a "file not found" error message logged?  Am I missing some obvious
detail that explains why this might be the desired and/or expected behavior?
Can anyone else demonstrate this behavior with their system?  Maybe I'm just
crazy?

BTW, I also verified, with the Cwd Perl module, that the current directory
of the httpd process was /usr/local/apache/htdocs/test-site/xsp, as
expected, when event.xsp was being processed.

Also, your included file must contain well-formed XML (I haven't really
tried to use the parse="text" attribute), including the requirement of
having the '<?xml version="1.0" encoding="UTF-8"?>' declaration.  When we
had errors in our included file, we didn't see anything unusual in the logs,
and only discovered our problem by accident.

--
Greg Estep <[EMAIL PROTECTED]>

> -----Original Message-----
> From: Mark Cance [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 21, 2002 1:17 PM
> To: axkit
> Subject: More Xinclude trouble...
>
>
> Hi,
>
> I�m either being stupid or its just time to go home. After reading all the
> postings etc I�m using the tag below to insert the contents of another XML
> doc within a xsp page (Its placed inside the <xsp:page> tag);
>
> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude";;
>     href="/content/common/copyright.xml"/>
>
> I�ve tried many many combinations but the inclusion is either ignored or I
> get the error;
>
> error parsing attribute name
> attributes construct error
> xmlParseStartTag: problem parsing attributes
> Couldn't find end of Start Tag
> <xi:include xmlns:xi="http://w
>
> Can anybody give me any pointers.
>
> Cheers.
>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to