Comments (14)
The most likely reason is because the xsd file is not currently on the MTConnect website. The best way to configure the MTConnect agent is to have it serve the xsd files directly.
Files {
schemas {
Path = ./schemas
Location = /schemas/
}
}
Where the path points to the directory where you have the XSD files. This will automatically serve up and associate the XSD files with the correct document. The Location
is the HTTP prefix for the XSD that gets mapped to the local direction referenced by Path
. You need to copy the XSD files that come with the agent into that directory (already in zip file in schemas).
By default it shouldn't validate the schema, but it may still be trying to reference. I don't do VB, but in C# I used XElement.parse instead of XDocument.
Hope this helps.
from cppagent.
If I add the information below to the agent.cfg:
Files {
schemas {
Path = ./schemas
Location = /schemas/
}
styles {
Path = ./styles
Location = /styles/
}
}
And put the folders (schemas and styles) from the source download in the same directory as the exe, this should cause it to use the stylesheet and the xsd files? I did this, but I did not put anything into the of the devices.xml. I’ve seen several examples of it, but I am new enough that it is hard to tell if I got it right. I am getting the message:
“This XML file does not appear to have any style information associated with it. The document tree is shown below.”
After doing that, so I am thinking I need to put something different. Do you have an example of what should go there if I am running the agent as localhost:5000/?
from cppagent.
The files need to be in the subdirectory indicated by path, not the same directory. The Path is there to tell the agent where to find the files. ./schemas is the schemas subdirectory of the current directory.
The message that there is no style info is not a problem, the browser will use the default formatting and it will not matter for an application since it will skip the processing instructions and xslt step.
from cppagent.
Does the xsd file then need to be updated? I looked at the XSD file that was in the source code and found this:
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:vc='http://www.w3.org/2007/XMLSchema-versioning' xmlns='urn:mtconnect.org:MTConnectDevices:1.3' xmlns:mt='urn:mtconnect.org:MTConnectDevices:1.3' targetNamespace='urn:mtconnect.org:MTConnectDevices:1.3' elementFormDefault='qualified' attributeFormDefault='unqualified' vc:minVersion='1.1'>
This is still referencing mtconnect.org. Do all of these need to be changed from "mtconnect.org" to "localhost:5000" or to "localhost:5000/schemas"? Also, when referencing the schema in the xml file, do I replace every reference to mtconnect.org to localhost:5000/schemas or to localhost:5000?
from cppagent.
There are only styles for the streams, not for the devices. You can add one of you want. The message has nothing to do with schema files.
Sent from my iPhone
On Oct 7, 2014, at 11:33, tomsnell [email protected] wrote:
If I add the information below to the agent.cfg:
Files {
schemas {
Path = ./schemas
Location = /schemas/
}
styles {
Path = ./styles
Location = /styles/
}
}And put the folders (schemas and styles) from the source download in the same directory as the exe, this should cause it to use the stylesheet and the xsd files? I did this, but I did not put anything into the of the devices.xml. I’ve seen several examples of it, but I am new enough that it is hard to tell if I got it right. I am getting the message:
“This XML file does not appear to have any style information associated with it. The document tree is shown below.”
After doing that, so I am thinking I need to put something different. Do you have an example of what should go there if I am running the agent as localhost:5000/?
From: William Sobel [mailto:[email protected]]
Sent: Tuesday, October 07, 2014 1:27 PM
To: mtconnect/cppagent
Cc: Tom Snell
Subject: Re: [cppagent] XML Client from Agent (#9)The most likely reason is because the xsd file is not currently on the MTConnect website. The best way to configure the MTConnect agent is to have it serve the xsd files directly.
Files {
schemas {
Path = ./schemas
Location = /schemas/
}
}
Where the path points to the directory where you have the XSD files. This will automatically serve up and associate the XSD files with the correct document. The Location is the HTTP prefix for the XSD that gets mapped to the local direction referenced by Path
By default it shouldn't validate the schema, but it may still be trying to reference. I don't do VB, but in C# I used XElement.parse instead of XDocument.
Hope this helps.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-58223598.
—
Reply to this email directly or view it on GitHub.
from cppagent.
My original problem is that I am trying to parse data from a machine. I used a text file version of what was coming from the machine (see my xml file on the original post). When I removed everything after the xsi:schemalocation=... it functioned. Then you said to put the XSD file on the local directory. I did that, but it still does the same thing. The agent source code adds its own XSD reference, so if I remove it completely from my devices.xml file, it still won't give me any data from my client because the agent code is referencing mtconnect.org. So I am trying to understand how to reference this file correctly in the devices.xml file and hopefully solve my original problem. All the examples that I could find reference the mtconnect.org web site and those files are no longer there, as you said.
from cppagent.
I don't see the schema location at all.
On Monday, October 13, 2014, tomsnell [email protected] wrote:
Does the xsd file then need to be updated? I looked at the XSD file that
was in the source code and found this:<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:vc='
http://www.w3.org/2007/XMLSchema-versioning' xmlns='urn:mtconnect.org:MTConnectDevices:1.3'
xmlns:mt='urn:mtconnect.org:MTConnectDevices:1.3'
targetNamespace='urn:mtconnect.org:MTConnectDevices:1.3'
elementFormDefault='qualified' attributeFormDefault='unqualified'
vc:minVersion='1.1'>This is still referencing mtconnect.org. Do all of these need to be
changed from "mtconnect.org" to "localhost:5000" or to
"localhost:5000/schemas"? Also, when referencing the schema in the xml
file, do I replace every reference to mtconnect.org to
localhost:5000/schemas or to localhost:5000?—
Reply to this email directly or view it on GitHub
#9 (comment).
- Will
Sent from my iPhone
from cppagent.
The header in your message did not have a reference to the schema location
at all. The urn references mtconnect.org, but this does not reference the
site.
I would suggest looking into how the references work. I'm not sure what is
going wrong since your warning from the browser has nothing to do with the
schema.
If I'm going to help you need to dump the errors from the application, not
the browser.
On Monday, October 13, 2014, tomsnell [email protected] wrote:
My original problem is that I am trying to parse data from a machine. I
used a text file version of what was coming from the machine (see my xml
file on the original post). When I removed everything after the
xsi:schemalocation=... it functioned. Then you said to put the XSD file on
the local directory. I did that, but it still does the same thing. The
agent source code adds its own XSD reference, so if I remove it completely
from my devices.xml file, it still won't give me any data from my client
because the agent code is referencing mtconnect.org. So I am trying to
understand how to reference this file correctly in the devices.xml file and
hopefully solve my original problem. All the examples that I could find
reference the mtconnect.org web site and those files are no longer there,
as you said.—
Reply to this email directly or view it on GitHub
#9 (comment).
- Will
Sent from my iPhone
from cppagent.
That was what I was referring to. The comment from 1 hr ago was from the XSD file that was in the schemas folder.
from cppagent.
This means it's not finding the schema in the directory references in the
cfg file.
On Monday, October 13, 2014, tomsnell [email protected] wrote:
[image: xmldata]
https://cloud.githubusercontent.com/assets/8961923/4546536/63d0c010-4e44-11e4-9c09-bbed9a23fe53.pngThat was what I was referring to. The comment from 1 hr ago was from the
XSD file that was in the schemas folder.—
Reply to this email directly or view it on GitHub
#9 (comment).
- Will
Sent from my iPhone
from cppagent.
That's another part of my problem is that I am not actually seeing an error in the client -- just no data. I will have to keep searching until I can either find the error I am getting or a better way to ask a question.
from cppagent.
You can also add a specific DevicesNamespaces configuration item:
DevicesNamespaces {
x {
Urn = urn:mtconnect.org:MTConnectDevices:1.3
Location = /schemas/MTConnectDevices_1.3.xsd
Path = ./schemas/MTConnectDevices_1.3.xsd
}
}
You can set the schema for each type of document. You can also use the 1.0 compatible schemas using the following:
DevicesNamespaces {
x {
Urn = urn:mtconnect.org:MTConnectDevices:1.3
Location = /schemas/MTConnectDevices_1.3.xsd
Path = ./schemas/MTConnectDevices_1.3_1.0.xsd
}
}
This is automatically done with the Files declaration if it finds a matching file pattern.
from cppagent.
Tom,
Maybe you should try the MSXML Object without LINQ (which offers one wrapper for XML and SQL). MSXML won’t parse using an XSD unless you tell it too with an explicit call. MSXML reads a URL but only reports bad XML.
MSXML creates a DOM tree object of the MTConnect Agent output – then you will have to use XPATH.
This will at least work. I have used MSXML and XPATH in a vbs and it works. So it will work in vb.net.
John
From: tomsnell [mailto:[email protected]]
Sent: Monday, October 13, 2014 3:25 PM
To: mtconnect/cppagent
Subject: Re: [cppagent] XML Client from Agent (#9)
That's another part of my problem is that I am not actually seeing an error in the client -- just no data. I will have to keep searching until I can either find the error I am getting or a better way to ask a question.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/9#issuecomment-58941778.
from cppagent.
This is not an agent issue.
from cppagent.
Related Issues (20)
- * uuid command handling in agent not as expected HOT 19
- AgentConfiguration::monitorThread message reports wrong number of seconds
- Crash when editing device dataitem in DeviceModel HOT 4
- XML Schema validation with lxml HOT 1
- Simple WebSockets for subscriptions HOT 3
- Add validation transform to support 2.5 quality attribute for observations.
- MQTT INGRESS connection not working on V2.3.0.4 HOT 5
- How to set initial dataitem value in the stream HOT 2
- Agent Reconnecting to Broker repeatedly HOT 20
- Condition ID format and example not matching on Agent version 2.3? HOT 25
- DELETEing an already deleted asset responds with old asset value; expected MTConnectError HOT 10
- Check why asset counts are not being reported in agent HOT 3
- json schema for agent cfg HOT 8
- Add pretty handling to assets
- Query Regarding FlatMode Configuration in MTConnect CPP Agent HOT 9
- Add header to Asset documents in 2.5
- Agent is suddenly closing itself HOT 22
- Cannot start service when cfg file has different name than default HOT 7
- MQTT Adapter disconnect HOT 16
- MQTT Ingress URL error HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cppagent.