Giter Club home page Giter Club logo

s1kd-tools's Introduction

s1kd-tools

A set of small, free and open source software tools for manipulating S1000D data.

Some examples of S1000D data sets produced with these tools are available here:

These tools are primarily developed around Issue 5.0 of the specification, and are generally compatibile with the previous 4.X issues. Support for Issue 3.0 and lower is a work-in-progress. Support for SGML schemas is not planned.

Additional links:

s1kd-tools's People

Contributors

kibook avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s1kd-tools's Issues

Regex Rules incorrectly matched

Hi,

I've been using the brex checker to check some DMs and for some reason below regex rule is always marked as violated, even when it shouldn't:

<structureObjectRule>
<objectPath allowedObjectFlag="2">//catalogSeqNumber/itemSeqNumber/partRef/@partNumberValue</objectPath>
<objectUse>The @partNumberValue attribute within the &lt;itemSeqNumber&gt;&lt;partRef&gt; element must be 1 to 15 characters long and only include A to Z (excluding "O" (oh)), 0 to 9, and "-" (hyphens).</objectUse>
<objectValue valueAllowed="^[-A-Z0-9-[O]]{1,15}$" valueForm="pattern"/>
</structureObjectRule>

This says cases like: LN9499-01-45 or NAS1833C08-370 do not match the pattern.

At first I thought this was because the regex processor you are using cannot handle cases like -[O] which excludes the letter O.

But even after manually adjusting the regex in the BREX to:
^[-A-NP-Z0-9]{1,15}$
This still marks everything as wrong (not matching the regex).

Do you have any idea why this happens?

Issues with installing s1kd-tools on macOS

Hello,
I'm trying to install the s1kd-tools from source on my macOS system (version 13.3, Apple M1 chip), but I'm encountering a few issues. I've followed the instructions in the install.md file, but I'm still unable to complete the installation successfully.

  1. When running make to build the tools, I get the following error while compiling the s1kd-dmrl tool:
    s1kd-dmrl.c:249:17: error: cannot take the address of an rvalue of type 'int' if ((err += WEXITSTATUS(system(line))) != 0 && failOnFirstErr) break; ^ ~~~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/wait.h:144:27: note: expanded from macro 'WEXITSTATUS' #define WEXITSTATUS(x) ((_W_INT(x) >> 8) & 0x000000ff) ^ ~ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/wait.h:131:34: note: expanded from macro '_W_INT' #define _W_INT(w) (*(int *)&(w)) /* convert union wait to int */ ^ ~ 1 error generated.
  2. During the make install step, I'm seeing warnings related to the old install command on macOS not recognizing the -D option:
    install: illegal option -- D usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 file2 install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode] [-o owner] file1 ... fileN directory install -d [-v] [-g group] [-m mode] [-o owner] directory ...
  3. I've tried different approaches suggested in the install.md file, such as:
    Using sudo to gain root privileges
    Modifying the Makefile to use mkdir and cp instead of install -D
    Attempting to install individual tools separately using make -C tools/s1kd-brexcheck install, etc.

However, none of these approaches have worked for me so far.
I have installed the required dependencies (gcc (Apple clang 15.0.0), make 3.81, xxd 2023 version, pkg-config 0.29.2, libxml2 2.9.13, and libxslt 1.1.35) on my macOS system.
Could you please provide guidance on how to resolve these issues and successfully install the s1kd-tools? Any help would be greatly appreciated.

Thank you!

s1kd-validate - Not working with network entities?

Hi,

I am trying to validate the schema for some DMs, and I am getting the below error:

s1kd-validate DMC-***.XML
s1kd-validate: ERROR: Attempt to load network entity http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd
s1kd-validate: ERROR: Failed to locate the main schema resource at 'http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd'.

Does the schema validator only work with local schemas?

s1kd-brexcheck - Not working correctly

Hi, I was just trying to check some simple brex rules for some DMs, but I am not sure if it is wokring at all.

The cmd I used:

s1kd-brexcheck -v -b DMC-S1000D-E-04-10-0301-00A-022A-D_009-00_EN-US.XML DMC-***.XML

The result is always:
s1kd-brexcheck: SUCCESS: DMC-***.XML validated successfully against BREX DMC-S1000D-E-04-10-0301-00A-022A-D_009-00_EN-US.XML.

Even though I obviously make some mistakes in the DM XML just to get an error message from the BREX checker.

For example, the standard BREX allows for @securityClassification the values from 01 to 09.
I added in my DM the value "11". And the check was succesful, instead of giving me an error.

Am I doing something wrong? or Does the BREX check only check some brex rules and not all of them ?

dmTypes

Hello,

When i do a newdm to make a front matter data module i've a new DM with descript schema and not frontmatter schema.

When i check the .dmtypes file, it's the same descript schema and not frontmatter schema.

It's a mistake or i've forget anything.

Sorry for my english, i'm french.

Thank you.

Failed to load *.xsd file when validate XML files

I am trying to build a PDF file from the example (build.sh in repo: s1kd-tools-doc). An error occurred in the validation step. Therefore I individually test command as: s1kd-validate DMC-EX-A-00-00-00-00A-000A-D_000-01_EN-CA.XML, which file located at s1kd-tools/tools/s1kd-validate/examples/namespace. The error messages occurred are as follow:

# s1kd-validate DMC-EX-A-00-00-00-00A-000A-D_000-01_EN-CA.XML 
s1kd-validate: ERROR: failed to load "http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd": Attempt to load network entity

s1kd-validate: ERROR: Attempt to load network entity: http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd
s1kd-validate: ERROR: Failed to locate the main schema resource at 'http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd'.

s1kd-validate: ERROR: failed to load "http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd": Attempt to load network entity

s1kd-validate: ERROR: Attempt to load network entity: http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd
s1kd-validate: ERROR: DMC-EX-A-00-00-00-00A-000A-D_000-01_EN-CA.XML (3): Element 'dmodule', attribute '{http://www.w3.org/2001/XMLSchema-instance}noNamespaceSchemaLocation': The document at location 'http://www.s1000d.org/S1000D_4-2/xml_schema_flat/descript.xsd' could not be acquired.
s1kd-validate: ERROR: DMC-EX-A-00-00-00-00A-000A-D_000-01_EN-CA.XML (3): Element 'dmodule': No matching global declaration available for the validation root.

It looks s1kd-validate required xsd files, but I am not sure how to locate this descript.xsd in my working directory, thanks for giving any idea about it.

s1kd-brexcheck ERROR: Invalid object path in BREX

Hi,

I have 2 huge BREX files, more than 8000 lines of code combined.
And the s1kd-brexcheck fails with ERROR: Invalid object path in BREX
Step by step I have commented the rules that were responsible for these errors. And found that there were only 4 rules that were causing such error.

Is there any option to run s1kd-brexcheck and ignore such errors?
More exactly, just skip the BREX rules that are "broken" (although they are not really broken, maybe xmlXPathEvalExpression is not 100% correct).

The rules that do not work:

<structureObjectRule id="RULE-153"> -->
	<objectPath allowedObjectFlag="1">/dmodule/pdf:style</objectPath>
	<objectUse>Custom PDF styling rules. Not S1000D compliant.</objectUse>
</structureObjectRule>
<structureObjectRule id="RULE-321">
      <objectPath allowedObjectFlag="0">(//dmStatus/applic/displayText/simplePara[lower-case(.)[contains(.,'FFF')]])</objectPath>
</structureObjectRule>
<structureObjectRule id="RULE-555">
   <objectPath allowedObjectFlag="1">//dmCode[attribute::infoCode != "003" and matches(@assyCode, '.{2}')]</objectPath>
</structureObjectRule>
<structureObjectRule id="RULE-677">
    <objectPath allowedObjectFlag="1">/dmodule/identAndStatusSection/pmStatus/reasonForUpdate[not(@id= /dmodule/content//@reasonForUpdateRefIds/tokenize(normalize-space(), '\t'))]</objectPath>
</structureObjectRule>

HTML publishing

Hello,
I'm very interesting by your project.
Have you the project to include an HTML publishing in your project ?

Thanks

s1kd-newdm --dump-templates

When I use this command with -$ 2.3, the generated models do not contain a version number of S1000D and do not match to 2.3 schema.

Building executables from source for Windows

Hi,

I see that you have on your website executables for windows (which I was using), but the instructions in INSTALL do not contain any info for Windows.
How can I build the executables for windows?
In order to get the latest changes to the brexcheck.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.