Is there a namespace I can set for my JiBX customizations - intellij-idea

Currently, I have the following JiXB customizations file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<schema-set>
<schema name="./target.xsd" >
<complexType name="type" ... />
</schema>
</schema-set>
This works nicely with the jibx-maven-plugin, and the customizations work as expected. However, to use code assist in IntelliJ Idea, I would like to define a XML namespace for the root element. If I point it to the codegen-customizations.xsd file in the JiBX site, I get an error.
<schema-set xmlns="http://jibx.sourceforge.net/schemas/codegen-customizations.xsd">
The error:
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] No unmarshaller for element "{http://jibx.sourceforge.net/schemas/codegen-customizations.xsd}schema-set" (line 2, col 84)
Furthermore, intellij shows the correct completion options, but complains Cannot find declaration of element 'schema-set'.
Is there a xml namespace I can use for my jibx customizations?

Related

Anypoint studio throws org.xml.sax.SAXParseException error

Im new to Mule/anypoint studio platform.
When i try to run mule projcet from anypoint studio I get following error[1].
I have added that particular jar in my classpath too (as an external jar, which appears in referenced libraries section too.) So i dont think it is classpath issue.
Also, same project works for others.only for me. I believe it is some environmental issue.The xml segment is as follows(namespace is defined correctly.)
What might be the cause for this? why anypoint studio is throwing error while deploying the project to runtime?
Im using anypoint studio version 7.4.1
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:json-logger="http://www.mulesoft.org/schema/mule/json-logger"
....
<json-logger:logger doc:name="Log Get Locations .../>
[1]aused by: org.mule.runtime.core.api.config.ConfigurationException: There were '3' errors while parsing the given file 'implementation/impl-locations.xml'.
Full list:
org.xml.sax.SAXParseException; lineNumber: 12; columnNumber: 171; cvc-complex-type.2.4.a: Invalid content was found starting with element 'json-logger:logger'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/core":description, "http://www.mulesoft.org/schema/mule/core":abstract-message-source, "http://www.mulesoft.org/schema/mule/core":abstract-message-processor, "http://www.mulesoft.org/schema/mule/core":abstract-mixed-content-message-processor}' is expected.
In addition to the namespace you have to add the schema location in the xsi:schemaLocation attribute.
Example:
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd"></mule>

Insert a source file in programlisting with xinclude in docbook

I've the following file tree
mainfolder
|-assembly.xml
|
|-chapters
| |-introduction.xml
|
|-source
|-example01
|-main.cpp
assembly.xml is the assembly file of my docbook. It contains a reference to introduction.xml.
This is the assembly:
<?xml version="1.0" encoding="UTF-8"?>
<assembly version="5.1"
xmlns="http://docbook.org/ns/docbook">
<resources xml:base="chapters/">
<resource href="introduction.xml" xml:id="introduction" />
</resources>
<structure xml:id="main-book">
<info>
<description>Book chapters</description>
</info>
<output renderas="book"/>
<module resourceref="introduction"/>
</structure>
</assembly>
introduction.xml is docbook chapter. I want to insert in it an example including the main.cpp.
<?xml version="1.0" encoding="UTF-8"?>
<chapter version="5.1"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<info>
<title>Introduction</title>
</info>
<section>
<info>
<title>Chapter title</title>
</info>
<para>
You can see an example:
</para>
<example>
<title>main example</title>
<programlisting language="c++">
<xi:include href="./../source/example01/maiin.cpp" parse="text" />
</programlisting>
</example>
</section>
</chapter>
Anyway, when I build the book (I'm using personal edition of XMLMind), I don't see anything. In the PDF the example is printed, but instead of the source code inside the main.cpp I see
<xi:include></xi:include>
What I'm doing wrong? How can I include the source code from the file?
I've reproduced your situation in a different ways and got things working in a both cases.
You didn't mention the exact steps you make to build a book using XMLMind XML Editor (XXE for short), but the following steps certainly worked well.
None 1: I've used XXE Professional Edition, but as I know the difference between versions is only in putting random character within text if generating PDF from Personal Edition.
Note 2: XXE says that <description>Book chapters</description> element is not allowed within you context. Despite that fact, the assembly can be generated successfully.
1. Getting things working within XXE
Open an assembly file in XXE.
Select Convert > Convert document > Convert to PDF.
Select a path to save pdf file and press OK button.
2. Getting things working manually in command line
Use your exact files and DIR structure (I included my own .c file sample for my own test).
Use XXE assembly processor: http://www.xmlmind.com/xmleditor/assembly.shtml - it has the same codebase that XXE used for working with assemblies from XXE GUI.
Get docbook book file from assembly:assembly-1_0_2_01/bin/assembly -v assembly.xml docbook_book.xml In my test I've got the .c sample file included - that proves that assembly utility works well with XInclude.
Get .pdf manually: fop -c <config_file> -xsl <path_to_docbook_ns_stylesheets>/fo/docbook.xsl -xml docbook_book.xml -pdf docbook_book.pdf
I've got the final result with .c sample included in both cases.

mobilefirst 8 Adapter xml file schema validation encountered errors

I am using MFP 8.0 and trying to build an adapter. Following is the code of it:
<?xml version="1.0" encoding="UTF-8"?>
<mfp:adapter name="TestAdapter"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mfp="http://www.ibm.com/mfp/integration"
xmlns:http="http://www.ibm.com/mfp/integration/http">
<displayName>TestAdapter</displayName>
<description>TestAdapter</description>
<connectivity>
<connectionPolicy xsi:type="http:HTTPConnectionPolicyType">
<protocol>http</protocol>
<domain>10.80.111.52</domain>
<port>8083</port>
<connectionTimeoutInMilliseconds>30000</connectionTimeoutInMilliseconds>
<socketTimeoutInMilliseconds>30000</socketTimeoutInMilliseconds>
<maxConcurrentConnectionsPerNode>50</maxConcurrentConnectionsPerNode>
</connectionPolicy>
</connectivity>
<procedure name="testProc" scope="restrictedResource"></procedure>
<JAXRSApplicationClass>com.example.UserLoginValidationApplication</JAXRSApplicationClass>
<securityCheckDefinition name="UserValidationSecurityCheck" class="com.example.UserLoginValidationResource"></securityCheckDefinition>
</mfp:adapter>
The procedure is defined in the js file. When I am building the adapter with mfpdev adapter build command I am getting below error:
[ERROR] Failed to execute goal com.ibm.mfp:adapter-maven-plugin:8.0.2016070421:build (default-build) on project TestAdapter: Adapter xml file schema validation encountered errors: [cvc-complex-type.2.4.a: Invalid content
'{procedure, property, securityCheckDefinition}' is expected.] -> [Help 1]
I am using mfpdev version 8.0.0-2016091519
As mentioned in the documentation, as well as stated in the error itself, you cannot have the <JAXRSApplicationClass> element in the server.xml.
Remove said element and the adapter will be built successfully.
See here: https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/8.0/authentication-and-security/creating-a-security-check/#defining-a-security-check

Octopus Deploy cannot find namespace in transform file

Have been trying to apply a transformation to one of my config files in Visual Studio 2010
The target file starts like this:
forms.config
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<formsDataProvider type="Sitecore.Forms.Data.DataProviders.WFMDataProvider,Sitecore.Forms.Core">
<param desc="connection string">connection string goes here</param>
</formsDataProvider>
...
The transformation file is as follows:
forms.Staging.config
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:x="http://www.sitecore.net/xmlconfig/" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<sitecore>
<formsDataProvider type="Sitecore.Forms.Data.DataProviders.WFMDataProvider,Sitecore.Forms.Core">
<param desc="connection string" xdt:Transform="Replace" xdt:Locator="Match(desc)">connection string for staging goes here</param>
</formsDataProvider>
</sitecore>
</configuration>
When the staging build runs on Octopus this is what's in the log:
DEBUG [XML Transformation] The expected namespace http://schemas.microsoft.com/XML-Document-Transform was not found in the transform file.
Have tried to remove the other xmlns attributes to no avail.
Said namespace is clearly on the transform file as an attribute in the configuration node. We have numerous other such files and transformations are applied fine. The Build Action for all transform files is set to Content.
Not sure if we can make Octopus log such messages as errors instead of Debug though.
Has anyone else had a similar problem?
Thanks in advance.
It looks like it might be trying to apply your forms.config as a transformation file instead of a target.
What do you have specified in the deployment step's Additional Transforms? Did you accidentally include forms.config itself?

how to import osgi blueprint xml

I am trying to import an OSGI blueprint XML file in to another OSGi blueprint XML file.
e.g.:
blueprint1.xml:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint ....>
<bean id="myBean1" class="com.company.Class1"/>
<bean id="myBean2" class="com.company.Class2"/>
</blueprint>
</xml>
blueprint2.xml:
<?xml version="1.0" encoding="UTF-8"?>
<blueprint ....>
<!-- DOES NOT WORK -->
<import resource="blueprint1.xml" />
</blueprint>
The <import> works for spring but not for blueprint.
Does anybody know a way of doing this in OSGi blueprint XML files?
Apparently, Spring like imports are not currently possible in blueprint.
However, if the files are in the same OSGi bundle then they are in the same context and can be used from other blueprint files.
Also, see here: http://fusesource.com/forums/message.jspa?messageID=15091#15091
If you're using Gemini Blueprint (formerly Spring DM) you can simply tell it to load both files, and basically treat them as if they were one big file:
In the absence of the Spring-Context header the extender expects every
".xml" file in the META-INF/spring folder to be a valid Spring
configuration file [...].
It also treats any xml files in /OSGI-INF in the same way.