newbie question with XSL

Discussion in 'XML' started by andrew_nuss@yahoo.com, Feb 12, 2007.

  1. Guest

    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
    , Feb 12, 2007
    #1
    1. Advertising

  2. roy axenov Guest

    On Feb 12, 10:54 pm, wrote:
    > 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.)

    --
    roy axenov
    roy axenov, Feb 12, 2007
    #2
    1. Advertising

  3. Myron Turner Guest

    xml on apache

    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
    Myron Turner, Feb 14, 2007
    #3
  4. Re: xml on apache

    I presume you've already done the obvious check of file/directory
    permissions at the filesystem level...
    Joseph Kesselman, Feb 14, 2007
    #4
  5. Myron Turner Guest

    Re: xml on apache

    Joseph Kesselman wrote:
    > 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
    Myron Turner, Feb 14, 2007
    #5
  6. Myron Turner Guest

    Re: xml on apache

    Joseph Kesselman wrote:
    > 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
    Myron Turner, Feb 15, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,002
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,704
    Kevin Flood
    Sep 13, 2004
  3. Vijay singh
    Replies:
    1
    Views:
    426
    Martin Honnen
    Nov 4, 2004
  4. Replies:
    1
    Views:
    3,571
    A. Bolmarcich
    May 27, 2005
  5. Rob Smegma
    Replies:
    1
    Views:
    1,789
    shaun
    Sep 26, 2005
Loading...

Share This Page