Ok, a better attempt to explain the problem:
The problem (not exact xml):
Start page:
<freePanel id="myPanel">
<button onCommand="xmodify/xmodify1.xml"/>
</freePanel>
xmodify/xmodify1.xml:
<append-child select="id('freePanel')">
<button img="myImage.gif" onCommand="myPage.jsp"/>
</append-child>
When I click on the button and load xmodify1.xml to get a second button,
where does the .gif on that second button come from, and where does the
onCommand point to?
Answer 1:
myImage.gif and myPage.jsp are both relative to the application start
page.
Reasoning: My web browser URL has not changed, and these should be
relative to the web-browser URL.
Issues: In my original onCommand I went into a folder, shouldn't the
page loaded one-level deeper reflect that in the URL resolution? Note
that if this were an HTML application and the onCommand was an href the
urls would be relative to the "xmodify" directory.
Answer 2:
myImage.gif and myPage.jsp are both relative to the xmodify directory.
Reasoning: That is where the xmodify1.xml page was served from, and
where I pointed to in my onCommand. Again note that if this were an HTML
application and the onCommand was an href the urls would be relative to
the "xmodify" directory. (As they are now)
Issues: I haven't actually moved pages, my browser URL is still the
same.
----
The trickyness here is that asynch updating is not a page based model.
In the case above I am loading new content but not swapping pages. If I
have a lot of content and start organizing into folders the URL
resolution becomes tricky.
Without getting into technical pros and cons or anything like that, what
answer makes more sense to people? It is really a judgement call.
My opinion would be that answer 2 makes more sense. If in your
client-side XML you point to a directory the stuff fed out from that
directory should be interpreted as relative to that directory.
James Margaris