Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / November 2006

Tip: Looking for answers? Try searching our database.

reading a file as an xsl instruction?

Thread view: 
Dhurandhar - 01 Nov 2006 05:34 GMT
How can I read a file as a template instruction in an xsl?

Upon matching a template, I need to add the contents of
an entire file in the result tree.

Is that possible?

(sorry if I am a bit fuzzy).

Regards,
D
Manish Pandit - 01 Nov 2006 06:49 GMT
> (sorry if I am a bit fuzzy).

Yeah, it is kind of fuzzy. Are you trying to use XSLT and transform an
XML document with the XSL ? You can take a look at cocoon/xalan-j XSLT
processor for more info on how to do that.

-cheers,
Manish
Mike Schilling - 01 Nov 2006 07:09 GMT
> How can I read a file as a template instruction in an xsl?
>
[quoted text clipped - 4 lines]
>
> (sorry if I am a bit fuzzy).

1. Write a custom XPath function, or
2.  Pass the contents of the file in as the value of an XSLT parameter.
Tor Iver Wilhelmsen - 01 Nov 2006 19:52 GMT
> Upon matching a template, I need to add the contents of
> an entire file in the result tree.

At the top:

<!DOCTYPE stylesheet (etc.) [
<!ENTITY includefile SYSTEM "thefile.xml">
]>

Then, in the template rule:

<xsl:template match="foo">
   &includefile;
</xsl:template>
Dhurandhar - 02 Nov 2006 01:20 GMT
> > Upon matching a template, I need to add the contents of
> > an entire file in the result tree.
[quoted text clipped - 10 lines]
>     &includefile;
> </xsl:template>

That worked, but partially (thanks).
I am finding that in the resulting document, some of the characters are
stripped off. Thus, if
thefile.xml contains something like ${a.b.c}/d/e, the resulting
document only has $/d/e.

Am I missing something?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.