OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] <programlisting> escape sequences and error: detected an error in element


Thanks. Maybe I don't understand what I should do? I
tried changing my example.xml to this ...

<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML
V4.1.2//EN"
"/usr/share/sgml/docbook/xml-dtd-4.2-1.0-17/docbookx.dtd">
<article>
        <articleinfo>
                <title>Example</title>
        </articleinfo>
        <sect1> <title>Example</title> <para>
<![ CDATA [
                                                      
                                                      
                 
WhichEncryptCipher () {
#######################
ENC_PROG_CIPHER=`cat /etc/recovery/EncryptedWith`
if [ -z "${ENC_PROG_CIPHER}" ]; then
        ENC_PROG_PASSWD=""
        ENC_PROG="cat"
else
        print "^[[1;33mEnter your encryption
password^[[36m\n"
        stty -echo &lt; `tty`
        read passwd &lt; `tty`
        stty echo &lt; `tty`
        #ENC_PROG_PASSWD="-pass pass:${passwd}"
        touch /tmp/.key
        chmod 600 /tmp/.key
        echo ${passwd} &lt; /tmp/.key
        ENC_PROG_PASSWD="-kfile /tmp/.key"
        ENC_PROG="openssl"
fi
}
]]>
                </para>
        </sect1>
</article>

And I get the this error ...

xsltproc -o example.html ../notes.xsl example.xml
example.xml:9: error: xmlParseStartTag: invalid
element name
<![ CDATA [
 ^

How should I be using CDATA?

Thanks


--- Camille Bégnis <camille@neodoc.biz> wrote:

> On Friday 10 September 2004 00:29, Sheldon Plankton
> wrote:
> > Hi,
> >
> > I am having problems with <programlisting> docbook
> tag
> > I think.  I want to list a shell script that makes
> use
> > of escape sequences to do fancy color stuff on the
> > terminal.   Yes I know that's a bad idea ... but
> it
> > ain't my script I just need to document it :)
> 
> Did you try enclosing your listing in a CDATA
> section?
> 
> > Here's is a short example of what I am doing ....
> >
> >
> >
> > bash-2.05b$ xsltproc -o example.html ../notes.xsl
> > example.xml
> > example.xml:18: error: detected an error in
> element
> > content
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: Premature end of data in
> tag
> > programlisting
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: detected an error in
> element
> > content
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: Premature end of data in
> tag
> > para
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: detected an error in
> element
> > content
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: Premature end of data in
> tag
> > sect1
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: detected an error in
> element
> > content
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: Premature end of data in
> tag
> > article
> >         print "Enter your encryption password\n"
> >         ^
> > example.xml:18: error: Extra content at the end of
> the
> > document
> >         print "Enter your encryption password\n"
> >         ^
> > unable to parse example.xml
> >
> > Here's what I have in example.xml ...
> >
> > <?xml version="1.0"?>
> > <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook
> XML
> > V4.1.2//EN"
> >
>
"/usr/share/sgml/docbook/xml-dtd-4.2-1.0-17/docbookx.dtd">
> > <article>
> >         <articleinfo>
> >                 <title>Example</title>
> >         </articleinfo>
> >         <sect1> <title>Example</title> <para>
> >                         <programlisting>
> >
> >
> >
> >
> > WhichEncryptCipher () {
> > #######################
> > ENC_PROG_CIPHER=`cat /etc/recovery/EncryptedWith`
> > if [ -z "${ENC_PROG_CIPHER}" ]; then
> >         ENC_PROG_PASSWD=""
> >         ENC_PROG="cat"
> > else
> >         print "^[[1;33mEnter your encryption
> > password^[[36m\n"
> >         stty -echo &lt; `tty`
> >         read passwd &lt; `tty`
> >         stty echo &lt; `tty`
> >         #ENC_PROG_PASSWD="-pass pass:${passwd}"
> >         touch /tmp/.key
> >         chmod 600 /tmp/.key
> >         echo ${passwd} > /tmp/.key
> >         ENC_PROG_PASSWD="-kfile /tmp/.key"
> >         ENC_PROG="openssl"
> > fi
> > }
> > #-----&lt;--------->-------
> >                         </programlisting>
> >                 </para>
> >         </sect1>
> > </article>
> > bash-2.05b$
> >
> > Also the &lt; are mine shouldn;t the
> programlisting
> > tag be able to deal with <'s ???
> >
> > Thanks
> > Sheldon :)
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Mail - 50x more storage than other
> providers!
> > http://promotions.yahoo.com/new_mail
> 
> -- 
> Camille Bégnis
> NeoDoc Co-Founder
> http://neodoc.biz
> 



		
_______________________________
Do you Yahoo!?
Shop for Back-to-School deals on Yahoo! Shopping.
http://shopping.yahoo.com/backtoschool


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]