Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes the <meta name="productname"> content #742

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

1 participant