Xmlreader Support Missing

0 views
Skip to first unread message

Casimiro Lurten

unread,
Aug 5, 2024, 12:33:46 AM8/5/24
to tinftunewsgrup
Thedata in XML files frequently includes hierarchical relationships. For example, an XML data file can represent catalogs and items in catalogs. Before the data can enter the data flow, the relationship of the elements in XML data file must be determined, and an output must be generated for each element in the file.

The XML source uses a schema to interpret the XML data. The XML source supports use of a XML Schema Definition (XSD) file or inline schemas to translate the XML data into a tabular format. If you configure the XML source by using the XML Source Editor dialog box, the user interface can generate an XSD from the specified XML data file.


The data in the XML files frequently includes hierarchical relationships. The XML Source Editor dialog box uses the specified schema to generate the XML source outputs. You can specify an XSD file, use an inline schema, or generate an XSD from the specified XML data file. The schema must be available at design time.


The XML source generates tabular structures from the XML data by creating an output for every element that contains other elements in the XML files. For example, if the XML data represents catalogs and items in catalogs, the XML source creates an output for catalogs and an output for each type of item that the catalogs contain. The output of each item will contain output columns for the attributes of that item.


To provide information about the hierarchical relationship of the data in the outputs, the XML source adds a column in the outputs that identifies the parent element for each child element. Using the example of catalogs with different types of items, each item would have a column value that identifies the catalog to which it belongs.


The XML source creates an output for every element, but it is not required that you use all the outputs. You can delete any output that you do not want to use, or just not connect it to a downstream component.


The XML source also generates the output names, to ensure that the names are unambiguous. These names may be long and may not identify the outputs in a way that is useful to you. You can rename the outputs, as long as their names remain unique. You can also modify the data type and the length of output columns.


For every output, the XML source adds an error output. By default the columns in error outputs have Unicode string data type (DT_WSTR) with a length of 255, but you can configure the columns in the error outputs by modifying their data type and length.


If the XML data file contains elements that are not in the XSD, these elements are ignored and no output is generated for them. On the other hand, if the XML data file is missing elements that are represented in the XSD, the output will contain columns with null values.


When the data is extracted from the XML data file, it is converted to an Integration Services data type. However, the XML source cannot convert the XML data to the DT_TIME2 or DT_DBTIMESTAMP2 data types because the source does not support these data types. For more information, see Integration Services Data Types.


The XSD or inline schema may specify the data type for elements, but if it does not, the XML Source Editor dialog box assigns the Unicode string data type (DT_WSTR) to the column in the output that contains the element, and sets the column length to 255 characters.


If the schema specifies the maximum length of an element, the length of output column is set to this value. If the maximum length is greater than the length supported by the Integration Services data type to which the element is converted, then the data is truncated to the maximum length of the data type. For example, if a string has a length of 5000, it is truncated to 4000 characters because the maximum length of the DT_WSTR data type is 4000 characters; likewise, byte data is truncated to 8000 characters, the maximum length of the DT_BYTES data type. If the schema specifies no maximum length, the default length of columns with either data type is set to 255. Data truncation in the XML source is handled the same way as truncation in other data flow components. For more information, see Error Handling in Data.


The XML source supports three different data access modes. You can specify the file location of the XML data file, the variable that contains the file location, or the variable that contains the XML data.


The XML source includes the XMLData and XMLSchemaDefinition custom properties that can be updated by property expressions when the package is loaded. For more information, see Integration Services (SSIS) Expressions, Use Property Expressions in Packages, and XML Source Custom Properties.


The Advanced Editor dialog box reflects the properties that can be set programmatically. For more information about the properties that you can set in the Advanced Editor dialog box or programmatically, click one of the following topics:


Generate XSD

Use the Save As dialog box to select a location for the auto-generated XSD schema file. The editor infers the schema from the structure of the XML data.


External Column

View external (source) columns in the order in which the task will read them. You can change this order by first clearing the selected columns in the table displayed in the editor, and then selecting external columns from the list in a different order.


Output Column

Provide a unique name for each output column. The default is the name of the selected external (source) column; however, you can choose any unique, descriptive name. The name provided will be displayed within SSIS Designer.


Set this value to selected cells

Specify what should happen to all the selected cells when an error or truncation occurs: ignore the failure, redirect the row, or fail the component.


Currently, I am trying to Parse attached XML File generated from Test Stand using Easy XML which contains TWO Test Results from Two different sequences. Please find the attached VI, which I am using. I have tried different options to parse both the Test Results by changing cluster constant as mentioned in below snapshot. Can you please let me know where I am going wrong? Thanks.


I think you didn't attach the XML file(s). You instead attached a docx file with screenshots of the XML files in Notepad++. We can't use those to test the VI. Can you upload the actual XML files you want processed?


Hello Cbutcher, Thanks for your response. Please find the attached XML file. Also, I have observed that not all the values are generated from the XML to Cluster in the VI. Let me know your comments. Thanks.


There are several XML "packages" for LabVIEW. All that I've tested are "self-consistent", that is, if you generate XML from LabVIEW structures, you can parse that XML and get the structures back. However, I'm less sure that they are "cross-consistent". In particular, the code generated by TestStand might not be exactly the same "flavor" of XML as JKI's EasyXML.


Hello Bill, Currently, the XML file generated from Test Stand contain results of two test sequences executed in Parallel. While I am parsing, I am able to parse the data related to only one test sequence (Not all elements). I am unable to parse the data for another test sequence which is available in the same XML file. I had tried to change the Cluster constant to match the XML format, but I did not have any luck parsing both the test results from the XML file. Thanks for your support.


For me, reading an xml file with anything is a slow and tedious effort and I just have to keep chugging away until I finally get it right. It sounds like you mostly have it right, because if you can read one test, you are very close to reading them all. It could be almost as simple as putting your code in a loop.


What is basically missing is that you need to have an array of tr:ResultSet and label this array trc:TestResults. Also, since you have the JKI Easy XML toolkit it would be much simpler to directly use the Easy Read XML File vi.


I am not sure how exactly it works, but saw a 30 minutes cache for update checks. So probably give it that time before trying other things. Also changing the channel to beta and back to stable might help.


NC27 is very new, and due to updates being offered in waves, this is quite expected. TheRaven500 has the issue that NC26 is not offered, which is unexpected and an issue since NC25 does not officially support PHP 8.2, used already.


Thank you! I have now manually updated to 26.0.3 and that worked perfectly. Sometimes a good advice is better than a helmet!

Edit:

Interesting is that now version 27.x.x is also not displayed. Looks like it asks only every 24h or something like that for a new version.

3a8082e126
Reply all
Reply to author
Forward
0 new messages