Where can I get a logback dtd? - logback

When I use logback.xml to config, it always cann't provide tips, so I wanne get a DTD schema for logback, where can I get it?
Thanks!

From the docs (emphasis added by me):
As will be demonstrated over and over, the syntax of logback configuration files is extremely flexible. As such, it is not possible to specify the allowed syntax with a DTD file or an XML schema. Nevertheless, the very basic structure of the configuration file can be described as, <configuration> element, containing zero or more <appender> elements, followed by zero or more <logger> elements, followed by at most one <root> element. The following diagram illustrates this basic structure.

Related

Convert multiple xsd files into SQL

I have a challenging situation.
ECHA publishes the schema for their IUCLID product as zipped collections of xsd files. I want to be able to import data into SQL and use those xsd files to build the SQL tables.
The trouble is while they publish a structure showing an ERD style relationship layout - https://poisoncentres.echa.europa.eu/documents/1789887/5577602/pcn_format_data_model_en.pdf/d667afb6-a36b-4596-48dc-3b2de436d3de?t=1635233313478 - the xsd does not have any sign of those relationships.. (though I might simply be missing them)
The xsd are found in here - https://poisoncentres.echa.europa.eu/documents/1789887/10223884/PCN+Format_v4.0.zip/7d7641c0-facc-898c-bffd-45b080bfdb75?t=1635502393893 and the general page is here - https://poisoncentres.echa.europa.eu/poison-centres-notification-format
I think my option is to do it the long way by converting xsd into SQL (pref Mysql dialect) via maybe a json schema and then hand stitching things together with the hope that there are no huge differences when they release a new version - but this feels icky :)
Does anyone have any thoughts on a better method?
EDIT:
So I also noticed this https://poisoncentres.echa.europa.eu/documents/1789887/6428404/echa_example_1_dossier.i6z/98873135-5373-d2df-0cc2-9177a403cad0?t=1590667188569 which is an example PCN document.. this at least gives relationships between chunks of xml, but I'm not sure these will always be available on new versions of the schema.. and boy its painful to parse..
So I'm going to steadily update this as I progress..
The first challenge is to bring all these XSDs into a single file so we can toss what is not being used and throw it into things like xsd2xml for generation of sample XML files..
How could I merge an XSD schema with imports and includes into a single file? Covers this - but much of what is mentioned is gone.
This - The 'minOccurs' attribute cannot be present looks tantalizing, but as usual all gone.
This looks the thing - https://sourceforge.net/projects/graphvisu/ but only wants HTTP - doesn't like file
Managed to get xsdwalker running - which shows up a problem.. it seems that the set of xsds doesn't really fit cleanly into a hierarchy.. which means we need to run with the sample xmls instead
Update:
Stupid me - the format uses href:xlink to reference other portions - but this isn't an XML cross reference, its just a href - so I am manually replacing the "name": { "xlink:type": "simple", "xlink:href": "52a44784-64a6-4836-b8d6-b84315fd958e_f53d48a9-17ef-48f0-8d0e-76d03007bdfe.i6d", "content": "Ethane-1,2-diol" },
with the expanded i6c:Document format - this is not pretty at all, and once I've coded something then I'll be cherry picking out what is needed... also as a complete facepalm and abuse of the XML format - almost everything in the XML i6c document is coded values - even though the idea of wasting all that bandwidth with readable variable names - is to have readable variables as well.. FFS
I compromised and inserted a "contents' key holding the referenced file contents - see Searching an XML structure but modifying a node higher in the hierarchy

Cutting a config file down to size

Morning!
I've got an app with a config file that's become unwieldy - many switches with no intuition as to which combinations are valid. Right now, all the switches are stored in an XML file. The config file specifies inputs for a large HPC job.
I'm thinking of writing some a formal grammar for a run - that is, the sort of combinations that are acceptable, and from the parsing of it, the switches needed will automatically be inferred. The values would still be read from the XML file, but only when needed.
Is this sort of approach reasonable? How would I go about implementing a grammar without a parser?
If I understand you correctly, you want to implement a Domain Specific Language (DSL), the purpose of which is to specify validation rules for the contents of an XML-based configuration file.
Some people implement a DSL by defining a parser specific to the needs of the DSL. However, some other people shoehorn the semantics of their DSL into the syntax of an existing file format, such as XML or JSON. So if you want to avoid having to write a parser, you could express your DSL in XML syntax.

Where can I look up the namespaces for stylecop rules so that I can suppress them?

There seem to various questions asking specifically how to suppress particular stylecop warnings, for example:
[SuppressMessage("Microsoft.StyleCop.CSharp.OrderingRules", "SA1202:ElementsMustBeOrderedByAccess"]
But where can I authoratively look to get the short name of the rule and (particularly) the namespace containing it. I have downloaded the stylecop project and looked at the project ruleset without finding anything useful. There seem to be some global rules prefixed SA, and I can't find a good reference on them.
This talks about suppressing rules, but doesn't lead to namespace information on SA rules
https://blogs.msdn.com/b/sourceanalysis/archive/2009/08/10/rule-suppressions.aspx?Redirected=true.
Documentation such as http://stylecop.soyuz5.com/SA1202.html is deeply unhelpful in providing the rule category name, but not the actual namespace.
I don't know about any published documentation containing that namespaces, but you can certainly look it up in the source code.
https://github.com/StyleCop/StyleCop/blob/007dc67059b53cc5a94be676f17ad3ea8881d4ad/Project/Src/StyleCop.CSharp.Rules/OrderingRules.cs
From the file above you can see that fully qualified name for ordering rules would be StyleCop.CSharp.OrderingRules.
https://github.com/StyleCop/StyleCop/blob/007dc67059b53cc5a94be676f17ad3ea8881d4ad/Project/Src/StyleCop.CSharp.Rules/OrderingRules.xml
From this file you can get shortname:longname values. For ordering rules we can see that it would be SA1202:ElementsMustBeOrderedByAccess.

XSLT to convert XML schema to HTML

I've made an XML schema but I don't know if I need an XSL stylesheet to show it in HTML. Do I need one? If I do, has anyone got an example which I could see and learn how to make one for my XML schema?
For an XSLT solution take a look at:
XS3P
XSDDoc, which produces JavaDoc-like documentation.
There are also a variety of tools that can produce W3C Schema documentation, such as:
oXygen
Stylus Studio
XML Schema Documenter

What does the url in XML file mean

I find this URL (or a similar one) always on HTML files, XML, XSD...
Like "http://www.w3.org/2001/XMLSchema" or "http://www.w3.org/2001/XMLSchema-instance"
I always wonder what those URLs means.
Even offline the XML or HTML document works without changes. What's the benefits on links to those URLs??
Thanks
Those URLs do not necessarily point to any website/server. They are a convenient naming mechanism. The idea is since every company will have a unique website, using that as their namespace will avoid clashes. Hence better interoperability. Hence the custom.
Namespaces in XML 1.0 Specification
It's the XML Schema.
An XML schema provides a view of the
document type at a relatively high
level of abstraction.