Re: [lfs-dev] Adding attributes in the source XML

2020-10-06 Thread Bruce Dubbs via lfs-dev

On 10/6/20 7:59 PM, Kevin Buckley via lfs-dev wrote:

On Tue, 6 Oct 2020 at 20:03, Pierre Labastie via lfs-dev
 wrote:




Where should such a declaration go?


The attribute has to be declared in the dtd (document type definition),
where anything pertaining to the xml document is declared (not only
attributes, but also tags and their content). For our docbook xml
sources, the dtd is pretty big, and comes from docbook. So you should
look at https://tdg.docbook.org/tdg/4.5/docbook.html, which gives the
details and the use of all tags and attributes. "revision" and "arch"
are attributes defined in the dtd. "pkguser" is not. But maybe,
condition="pkguser" could be used, since condition is a declared
attribute (
https://tdg.docbook.org/tdg/4.5/ref-elements.html#common.attributes),
and the stringparam profile.condition="pkguser" for profiling. Another
attribute name could be "userlevel"... Note that any attribute name
declared in the dtd could be used provided _you_ know what you use it
for, if you do not want to share your work.

Pierre



and Thomas echoed pointed out


Those attributes like 'arch', 'revision' etc. are defined somewhere in
the deepness of docbook. You cannot simply introduce new ones by
adding them to the string parameter list for the renderer. All the
attributes used in the {B,}LFS-book are predefined ones.

You may have allready seen the pages at
http://www.sagehill.net/docbookxsl/AddProfileAtt.html - the talk about
"how easy it is to add". Well, i didn't find it that easy, maybe you
have more luck.

--
Thomas


which suggests I missed picking up the knowledge as regards 'arch' and
'revision' NOT being something that LFS had added.

Wow!

All this time, and I had assumed that LFS had extended the Schema/DTD
so as to use certain attributes that appeared specific to LFS.

Cheers for pointing that out: I'll "make other plans" !


See https://tdg.docbook.org/tdg/4.5/ref-elements.html#common.attributes 
for the defined attributes.   To translate those attributes to html you 
still need a custom xsl like stylesheets/lfs-chunked.xsl and the files 
in stylesheets/lfs-xsl/.  Learning xsl is definitely a non-trivial task. 
 It is not a procedural language.  Generally we try to avoid changing 
the xsl due to its complexity.


  -- Bruce
--
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Re: [lfs-dev] Adding attributes in the source XML

2020-10-06 Thread Kevin Buckley via lfs-dev
On Tue, 6 Oct 2020 at 20:03, Pierre Labastie via lfs-dev
 wrote:
>
> >
> > Where should such a declaration go?
>
> The attribute has to be declared in the dtd (document type definition),
> where anything pertaining to the xml document is declared (not only
> attributes, but also tags and their content). For our docbook xml
> sources, the dtd is pretty big, and comes from docbook. So you should
> look at https://tdg.docbook.org/tdg/4.5/docbook.html, which gives the
> details and the use of all tags and attributes. "revision" and "arch"
> are attributes defined in the dtd. "pkguser" is not. But maybe,
> condition="pkguser" could be used, since condition is a declared
> attribute (
> https://tdg.docbook.org/tdg/4.5/ref-elements.html#common.attributes),
> and the stringparam profile.condition="pkguser" for profiling. Another
> attribute name could be "userlevel"... Note that any attribute name
> declared in the dtd could be used provided _you_ know what you use it
> for, if you do not want to share your work.
>
> Pierre
>

and Thomas echoed pointed out

> Those attributes like 'arch', 'revision' etc. are defined somewhere in
> the deepness of docbook. You cannot simply introduce new ones by
> adding them to the string parameter list for the renderer. All the
> attributes used in the {B,}LFS-book are predefined ones.
>
> You may have allready seen the pages at
> http://www.sagehill.net/docbookxsl/AddProfileAtt.html - the talk about
> "how easy it is to add". Well, i didn't find it that easy, maybe you
> have more luck.
>
> --
> Thomas

which suggests I missed picking up the knowledge as regards 'arch' and
'revision' NOT being something that LFS had added.

Wow!

All this time, and I had assumed that LFS had extended the Schema/DTD
so as to use certain attributes that appeared specific to LFS.

Cheers for pointing that out: I'll "make other plans" !

Kevin
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Re: [lfs-dev] Adding attributes in the source XML

2020-10-06 Thread Thomas Trepl via lfs-dev
Am Dienstag, den 06.10.2020, 18:48 +0800 schrieb Kevin Buckley via
lfs-dev:
> i was experimenting with making use of an extra attribute in the
> XML source tags, akin to the vanilla book's  'sysv'  or 'systemd'
> for the "revision" attribute,, or to Thomas's Multilib arch attribute
> ('ml_32', 'ml_x32' or 'ml_all').
> 
> When i come to render my source, having added an extra
> stringparam to the xsltproc invocations, vis
> 
> --stringparam profile.revision $(REV) \
> --stringparam profile.arch $(ARCH)\
> --stringparam profile.pkguser $(PKGUSER)\
> 
> I get told
> 
> validity error : No declaration for attribute pkguser of element 
> 
> I realise that I have missed adding such a declaration into one of the
> stylesheet, or other ancillary, files but I can't determine, by inspection
> of many of those files, where such a declaration needs to go.
> 
> Where should such a declaration go?

Those attributes like 'arch', 'revision' etc. are defined somewhere in
the deepness of docbook. You cannot simply introduce new ones by
adding them to the string parameter list for the renderer. All the
attributes used in the {B,}LFS-book are predefined ones.

You may have allready seen the pages at 
http://www.sagehill.net/docbookxsl/AddProfileAtt.html - the talk about
"how easy it is to add". Well, i didn't find it that easy, maybe you
have more luck.

--
Thomas

-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Re: [lfs-dev] Adding attributes in the source XML

2020-10-06 Thread Pierre Labastie via lfs-dev
On Tue, 2020-10-06 at 18:48 +0800, Kevin Buckley via lfs-dev wrote:
> i was experimenting with making use of an extra attribute in the
> XML source tags, akin to the vanilla book's  'sysv'  or 'systemd'
> for the "revision" attribute,, or to Thomas's Multilib arch attribute
> ('ml_32', 'ml_x32' or 'ml_all').
> 
> When i come to render my source, having added an extra
> stringparam to the xsltproc invocations, vis
> 
> --stringparam profile.revision $(REV) \
> --stringparam profile.arch $(ARCH)\
> --stringparam profile.pkguser $(PKGUSER)\
> 
> I get told
> 
> validity error : No declaration for attribute pkguser of element
> 
> 
> I realise that I have missed adding such a declaration into one of
> the
> stylesheet, or other ancillary, files but I can't determine, by
> inspection
> of many of those files, where such a declaration needs to go.
> 
> Where should such a declaration go?

The attribute has to be declared in the dtd (document type definition),
where anything pertaining to the xml document is declared (not only
attributes, but also tags and their content). For our docbook xml
sources, the dtd is pretty big, and comes from docbook. So you should
look at https://tdg.docbook.org/tdg/4.5/docbook.html, which gives the
details and the use of all tags and attributes. "revision" and "arch"
are attributes defined in the dtd. "pkguser" is not. But maybe,
condition="pkguser" could be used, since condition is a declared
attribute (
https://tdg.docbook.org/tdg/4.5/ref-elements.html#common.attributes),
and the stringparam profile.condition="pkguser" for profiling. Another
attribute name could be "userlevel"... Note that any attribute name
declared in the dtd could be used provided _you_ know what you use it
for, if you do not want to share your work.

Pierre



-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

[lfs-dev] Adding attributes in the source XML

2020-10-06 Thread Kevin Buckley via lfs-dev
i was experimenting with making use of an extra attribute in the
XML source tags, akin to the vanilla book's  'sysv'  or 'systemd'
for the "revision" attribute,, or to Thomas's Multilib arch attribute
('ml_32', 'ml_x32' or 'ml_all').

When i come to render my source, having added an extra
stringparam to the xsltproc invocations, vis

--stringparam profile.revision $(REV) \
--stringparam profile.arch $(ARCH)\
--stringparam profile.pkguser $(PKGUSER)\

I get told

validity error : No declaration for attribute pkguser of element 

I realise that I have missed adding such a declaration into one of the
stylesheet, or other ancillary, files but I can't determine, by inspection
of many of those files, where such a declaration needs to go.

Where should such a declaration go?
-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page