Skip to content

Conversation

@tomschr
Copy link
Collaborator

@tomschr tomschr commented Jan 13, 2025

In an assembly file, you can add or remove <productname> elements from <meta name="productname">.

The stylesheet CAN NOT preserve entities! This needs to be done outside, usually with sed.

The stylesheet contains several checks:

  • Checks if the root element is an <assembly> element and belongs to the DocBook 5 namespace.
    If not, the stylesheet returns an error messages and refuses to continue.
  • Checks if the required XSLT parameters version, product, and op are set.
    If not set, the stylesheet returns an error message and refuses to continue.
  • Checks if there are more than one <structure> element.
    If yes, it's expected that the structure.id parameter points to the ID. If not, the stylesheet returns a error message and refuses to continue.
  • Checks if the ID of the <structure xml:id="ID"> is there.
    If not, the stylesheet returns a error message and refuses to continue
  • Checks, if there is a <meta name="productname"> element.
    If not, the stylesheet returns a warning and continues.
  • When op = "add" and there is already a <productname> with the same content, return a warning and continue
  • When op = "remove" and there is no <productname> with the requested content, return a warning and continue.

Examples

Adding content

$ xsltproc --stringparam op add \
           --stringparam version "16-SP1" \
           --stringparam product "SLES" \
           $DAPS_PATH/daps-xslt/contrib/change-products-on-assembly.xsl \
           articles/Micro-upgrade.asm.xml

Removing content

You can also use remove or r for the op XSLT parameter:

$ xsltproc --stringparam op rm \
           --stringparam version "16-SP1" \
           --stringparam product "SLES" \
           $DAPS_PATH/daps-xslt/contrib/change-products-on-assembly.xsl \
           articles/Micro-upgrade.asm.xml

In an assembly file, you can add or remove `<productname>` elements from
`<meta name="productname">.`

The stylesheet contains several checks:

* Checks if the root element is `<assembly>` and belongs to the DocBook 5
  namespace. If not, it returns a error messages and refuses to continue
* Checks if the required XSLT parameters version, product, and op are set.
  If not set, the stylesheet it returns a error messages and refuses to continue
* Checks if there are more than one `<structure>` element.
  If yes, it's expected to set the structure.id parameter
* Checks if the ID of the `<structure xml:id="ID">` is there.
  If not, the stylesheet it returns a error messages and refuses to continue
* Checks, if there is a `<meta name="productname">` element.
  If not, the stylesheet returns a warning and continues
* When op = "add" and there is already an existing `<productname>` with
  the same content, return a warning and continue
* When op = "remove" and there is no `<productname>` with the requested
  content, return a warning and continue.

For example:

  $ xsltproc --stringparam op add \
             --stringparam version "16-SP1" \
             --stringparam product "SLES" \
              $DAPS_PATH/daps-xslt/contrib/change-products-on-assembly.xsl \
              articles/Micro-upgrade.asm.xml
@tomschr tomschr self-assigned this Jan 13, 2025
@tomschr tomschr added the topic-assembly Everything related to assembly processing label Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic-assembly Everything related to assembly processing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants