-
Notifications
You must be signed in to change notification settings - Fork 91
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
XML Client from Agent #9
Comments
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.
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 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. |
If I add the information below to the agent.cfg: Files { 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/? |
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. |
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? |
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
|
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. |
I don't see the schema location at all. On Monday, October 13, 2014, tomsnell notifications@github.com wrote:
Sent from my iPhone |
The header in your message did not have a reference to the schema location I would suggest looking into how the references work. I'm not sure what is If I'm going to help you need to dump the errors from the application, not On Monday, October 13, 2014, tomsnell notifications@github.com wrote:
Sent from my iPhone |
This means it's not finding the schema in the directory references in the On Monday, October 13, 2014, tomsnell notifications@github.com wrote:
Sent from my iPhone |
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. |
You can also add a specific DevicesNamespaces configuration item:
You can set the schema for each type of document. You can also use the 1.0 compatible schemas using the following:
This is automatically done with the Files declaration if it finds a matching file pattern. |
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. From: tomsnell [mailto:notifications@github.com] 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. — |
This is not an agent issue. |
Refactored ChangeObserver to remove dlib
I am attempting to make a client in Visual Studio 2013 in vb.net. When I read it with the following code:
It would not function, so I copied the XML code from the browser from my agent and attempted to manipulate it until I could get results. When I removed the reference to the XML schema, it would then give me the information from the xml file. I attempted to update the devices.xml file without the reference to the xml schema, it was still putting it in. I found something in the source code of the cppagent that was causing this, so I am thinking that the xml schema is correct. As shown in the picture, Visual Studio doesn't like the xsi. Anyone have any ideas on what I am missing?
So the xml that I used is (after removing the xsi:schemalocation...):
The text was updated successfully, but these errors were encountered: