newbie question with XSL

A

andrew_nuss

Hi,

Assuming that I have a simple XML dtd, that defines a <section> tag as
follows:

a <section> consists of 1 or more (<code> OR <para> OR <list> OR
<table> elements)

How do I create a transformation for <section> and apply it such that
the transformations
of <code>, <para>, <list>, and <table> are applied as needed as each
element is
encountered in the <section>?

Andy
 
R

roy axenov

Assuming that I have a simple XML dtd, that defines a
<section> tag as follows:

You probably mean section element, not tag.
a <section> consists of 1 or more (<code> OR <para> OR
<list> OR <table> elements)

How do I create a transformation for <section> and apply
it such that the transformations of <code>, <para>,
<list>, and <table> are applied as needed as each element
is encountered in the <section>?

What have you tried? This seems like a very basic task that
would be covered in pretty much any XSLT tutorial.
Precisely what is your problem with achieving the desired
results?

<xsl:template match="section">
<xsl:apply-templates select="@*|node()"
mode="section"/>
</xsl:template>
<xsl:template match="@*|node()" mode="section">
<xsl:message terminate="yes">
Invalid markup.
</xsl:message>
</xsl:template>
<xsl:template match="section/code" mode="section">
template for code element
</xsl:template>
<xsl:template match="section/para" mode="section">
template for para element
</xsl:template>
<xsl:template match="section/list" mode="section">
template for list element
</xsl:template>
<xsl:template match="section/para" mode="section">
template for para element
</xsl:template>

(Untested.)
 
M

Myron Turner

This may be slightly off topic, but it may be the kind of thing someone
on this list has encountered.

I'm working on a Linux machine running Fedora Core 6 and Apache/2.2.3,
php 5. I developed web-based application on a machine running Fedor 4
and Apache/2.0.54

This application accesses xml files. But the Apache error logs tell me
that I do not have permission to access the xml files; and when I do an
index of the directory where the files are located, the xml files do
not show up in the browser--everything else does.

Am I missing an AddType? I've checked the Fedora 4 httpd.conf and can't
find an AddType for the xml files. I've also tested xml files and used
them on Fedora 4 also running Apache/2.0.54.

/etc/mime.types seems to have the same configuration on all machines.

I've been working with xml for several years on a variety of Linux
configurations and never have run into this before.


Thanks,

Myron Turner
 
J

Joseph Kesselman

I presume you've already done the obvious check of file/directory
permissions at the filesystem level...
 
M

Myron Turner

Joseph said:
I presume you've already done the obvious check of file/directory
permissions at the filesystem level...

Yes, everything seems correct. The files are set at 644, the directory
is 755. I've even gone so far as to create a dedicated user and have set
both the directory and the files to the same user.

Thanks,

Myron
 
M

Myron Turner

Joseph said:
I presume you've already done the obvious check of file/directory
permissions at the filesystem level...


--
It turns out that Selinux is in effect, this is Fedora 6, and it adds
another layer of security and headaches. It comes installed on earlier
versions of Fedora but has not been, in my experience, on by default.

Thanks for your interest,

Myron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top