473,407 Members | 2,326 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Anyone is working on PCATS XML standard?

I am having problem opening the XAL file in the browser because the xmlns
URL and xsi URL are invalid.
If I would like to ignore those, what's the way to get the data into an
SQLserver table?

Thanks
Bill

<?xml version="1.0"?>
<pcats:NAXML-FuelsDoc
xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16
NAXML-FuelPrice15.xsd" version="1.5">
<pcats:TransmissionHeader>
<pcats:TransmissionId>200705311139</pcats:TransmissionId>
<pcats:TransmissionDate>2007-05-31</pcats:TransmissionDate>
<pcats:TransmissionTime>11:39:17-06:00</pcats:TransmissionTime>
<pcats:TransmissionStatus>original</pcats:TransmissionStatus>
<pcats:TransmissionSender>Musket Corporation</pcats:TransmissionSender>
<pcats:TransmissionAgency>DTN Integrated
Services/dtnDataConnect</pcats:TransmissionAgency>
</pcats:TransmissionHeader>
<pcats:FuelPriceInfo>
<pcats:Terminal>
<pcats:Name identType="PlantNumber" ident="1132">
<pcats:NamePrefix>Stck ST Service</pcats:NamePrefix>
</pcats:Name>
<pcats:City>Stockton</pcats:City>
<pcats:State>CA</pcats:State>
<pcats:FuelProduct><pcats:EffectiveDate>2007-05-30</pcats:EffectiveDate>
<pcats:EffectiveTime>12:01:00</pcats:EffectiveTime>
<pcats:FuelProductId identType="Ultra Low Sulfur CARB
#2">0402</pcats:FuelProductId>
<pcats:Price>2.210000</pcats:Price>
<pcats:NetChange>.000000</pcats:NetChange>
</pcats:FuelProduct>
</pcats:Terminal>
</pcats:FuelPriceInfo>
</pcats:NAXML-FuelsDoc>
Jun 1 '07 #1
5 4470
"Bill Nguyen" <bi*****************@jaco.comwrote in message
news:el**************@TK2MSFTNGP04.phx.gbl...
>I am having problem opening the XAL file in the browser because the xmlns
URL and xsi URL are invalid.
If I would like to ignore those, what's the way to get the data into an
SQLserver table?
The xmlns are not web locations. The problem would be that
"NAXML-FuelPrice15.xsd" is not being found. Try removing the entire
xsi:schemaLocation attribute.
--
John Saunders [MVP]
Jun 1 '07 #2
Contact PCATS at http://www.pcats.org to acquire a copy of the schema.
Then group the schema files in the directory with your XML file to allow
the browser to open and validate the XML.

If you want to process the file in code without access to the XSD files,
use an XMLReader with an XMLReaderSettings object that has the
XMLReaderSettings.ValidationType set to ValidationType.None.

For example, the code below employs an XSL file to transform the XML
into the desired format (output to a file thru a StreamWriter). Given
that you're processing a bill of lading document, you may want to load
the XML into an XMLDocument object and peel out the pieces you need.

using (FileStream fs = File.Open(uploadFilename, FileMode.Create,
FileAccess.ReadWrite, FileShare.None))
{
FileInfo SourceFile = new FileInfo(XmlFilePath);
// Establish the settings for the XmlReader
XmlReaderSettings ReaderSettings = new XmlReaderSettings();
ReaderSettings.CloseInput = true;
ReaderSettings.ConformanceLevel = ConformanceLevel.Document;
ReaderSettings.ProhibitDtd = false;
// Disable validation
ReaderSettings.ValidationType = ValidationType.None;
// Create the reader
XmlReader Reader = XmlReader.Create(SourceFile.FullName,
ReaderSettings);
XPathDocument XPathDoc = new XPathDocument(Reader);
XPathNavigator XPathNav = XPathDoc.CreateNavigator();
// Create some XsltSettings and load the stylesheet
XsltSettings XSLTSettings = new XsltSettings(false, true);
XslCompiledTransform XSLT = new XslCompiledTransform();
XSLT.Load(StyleSheet);
// Do the XSLT transform.
XSLT.Transform(XPathDoc, XSLTArgs, fs);
Reader.Close();
fs.Close();
}
*** Sent via Developersdex http://www.developersdex.com ***
Jun 2 '07 #3
Thanks a lot Bill & John!

Bill

"Bill Wade" <bw***@profdata.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Contact PCATS at http://www.pcats.org to acquire a copy of the schema.
Then group the schema files in the directory with your XML file to allow
the browser to open and validate the XML.

If you want to process the file in code without access to the XSD files,
use an XMLReader with an XMLReaderSettings object that has the
XMLReaderSettings.ValidationType set to ValidationType.None.

For example, the code below employs an XSL file to transform the XML
into the desired format (output to a file thru a StreamWriter). Given
that you're processing a bill of lading document, you may want to load
the XML into an XMLDocument object and peel out the pieces you need.

using (FileStream fs = File.Open(uploadFilename, FileMode.Create,
FileAccess.ReadWrite, FileShare.None))
{
FileInfo SourceFile = new FileInfo(XmlFilePath);
// Establish the settings for the XmlReader
XmlReaderSettings ReaderSettings = new XmlReaderSettings();
ReaderSettings.CloseInput = true;
ReaderSettings.ConformanceLevel = ConformanceLevel.Document;
ReaderSettings.ProhibitDtd = false;
// Disable validation
ReaderSettings.ValidationType = ValidationType.None;
// Create the reader
XmlReader Reader = XmlReader.Create(SourceFile.FullName,
ReaderSettings);
XPathDocument XPathDoc = new XPathDocument(Reader);
XPathNavigator XPathNav = XPathDoc.CreateNavigator();
// Create some XsltSettings and load the stylesheet
XsltSettings XSLTSettings = new XsltSettings(false, true);
XslCompiledTransform XSLT = new XslCompiledTransform();
XSLT.Load(StyleSheet);
// Do the XSLT transform.
XSLT.Transform(XPathDoc, XSLTArgs, fs);
Reader.Close();
fs.Close();
}
*** Sent via Developersdex http://www.developersdex.com ***

Jun 3 '07 #4
Bill;
I can seem to obtain the schema from Pcats.org
I am completely new to XML in .NET environment.

Can I just create a DTD based on the XML file and use it with my app (VB.NET
2005)? Otherwise, can you give me some idea on how to setup XSL for the
following data elements?
Thanks a million!

Bill
-------------

<?xml version="1.0"?>
<pcats:NAXML-FuelsDoc
xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16
NAXML-FuelPrice15.xsd" version="1.5">
<pcats:TransmissionHeader>
<pcats:TransmissionId>200607311642</pcats:TransmissionId>
<pcats:TransmissionDate>2006-07-31</pcats:TransmissionDate>
<pcats:TransmissionTime>16:42:23-06:00</pcats:TransmissionTime>
<pcats:TransmissionStatus>original</pcats:TransmissionStatus>
<pcats:TransmissionSender>BP Products Unbranded</pcats:TransmissionSender>
<pcats:TransmissionAgency>DTN Integrated
Services/dtnDataConnect</pcats:TransmissionAgency>
</pcats:TransmissionHeader>
<pcats:FuelPriceInfo>
<pcats:Terminal>
<pcats:Name identType="PlantNumber" ident="1074">
<pcats:NamePrefix>LngB BP Oil</pcats:NamePrefix>
</pcats:Name>
<pcats:City>Long Beach</pcats:City>
<pcats:State>CA</pcats:State>
<pcats:FuelProduct><pcats:EffectiveDate>2006-07-31</pcats:EffectiveDate>
<pcats:EffectiveTime>12:30:00</pcats:EffectiveTime>
<pcats:FuelProductId identType="Ultra Low Sulfur CARB
#2">0402</pcats:FuelProductId>
<pcats:Price>2.185000</pcats:Price>
<pcats:NetChange>-.007500</pcats:NetChange>
</pcats:FuelProduct>
</pcats:Terminal>
</pcats:FuelPriceInfo>
</pcats:NAXML-FuelsDoc>

"Bill Wade" <bw***@profdata.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Contact PCATS at http://www.pcats.org to acquire a copy of the schema.
Then group the schema files in the directory with your XML file to allow
the browser to open and validate the XML.

If you want to process the file in code without access to the XSD files,
use an XMLReader with an XMLReaderSettings object that has the
XMLReaderSettings.ValidationType set to ValidationType.None.

For example, the code below employs an XSL file to transform the XML
into the desired format (output to a file thru a StreamWriter). Given
that you're processing a bill of lading document, you may want to load
the XML into an XMLDocument object and peel out the pieces you need.

using (FileStream fs = File.Open(uploadFilename, FileMode.Create,
FileAccess.ReadWrite, FileShare.None))
{
FileInfo SourceFile = new FileInfo(XmlFilePath);
// Establish the settings for the XmlReader
XmlReaderSettings ReaderSettings = new XmlReaderSettings();
ReaderSettings.CloseInput = true;
ReaderSettings.ConformanceLevel = ConformanceLevel.Document;
ReaderSettings.ProhibitDtd = false;
// Disable validation
ReaderSettings.ValidationType = ValidationType.None;
// Create the reader
XmlReader Reader = XmlReader.Create(SourceFile.FullName,
ReaderSettings);
XPathDocument XPathDoc = new XPathDocument(Reader);
XPathNavigator XPathNav = XPathDoc.CreateNavigator();
// Create some XsltSettings and load the stylesheet
XsltSettings XSLTSettings = new XsltSettings(false, true);
XslCompiledTransform XSLT = new XslCompiledTransform();
XSLT.Load(StyleSheet);
// Do the XSLT transform.
XSLT.Transform(XPathDoc, XSLTArgs, fs);
Reader.Close();
fs.Close();
}
*** Sent via Developersdex http://www.developersdex.com ***

Jun 4 '07 #5
I am having problem opening the XAL file in the browser because the xmlns
URL and xsi URL are invalid.
If I would like to ignore those, what's the way to get the data into an
SQLserver table?

Thanks
Bill

<?xml version="1.0"?>
<pcats:NAXML-FuelsDoc
xmlns="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.naxml.org/Retail-EDI/Vocabulary/2003-10-16
NAXML-FuelPrice15.xsd" version="1.5">
<pcats:TransmissionHeader>
<pcats:TransmissionId>200705311139</pcats:TransmissionId>
<pcats:TransmissionDate>2007-05-31</pcats:TransmissionDate>
<pcats:TransmissionTime>11:39:17-06:00</pcats:TransmissionTime>
<pcats:TransmissionStatus>original</pcats:TransmissionStatus>
<pcats:TransmissionSender>Musket Corporation</pcats:TransmissionSender>
<pcats:TransmissionAgency>DTN Integrated
Services/dtnDataConnect</pcats:TransmissionAgency>
</pcats:TransmissionHeader>
<pcats:FuelPriceInfo>
<pcats:Terminal>
<pcats:Name identType="PlantNumber" ident="1132">
<pcats:NamePrefix>Stck ST Service</pcats:NamePrefix>
</pcats:Name>
<pcats:City>Stockton</pcats:City>
<pcats:State>CA</pcats:State>
<pcats:FuelProduct><pcats:EffectiveDate>2007-05-30</pcats:EffectiveDate>
<pcats:EffectiveTime>12:01:00</pcats:EffectiveTime>
<pcats:FuelProductId identType="Ultra Low Sulfur CARB
#2">0402</pcats:FuelProductId>
<pcats:Price>2.210000</pcats:Price>
<pcats:NetChange>.000000</pcats:NetChange>
</pcats:FuelProduct>
</pcats:Terminal>
</pcats:FuelPriceInfo>
</pcats:NAXML-FuelsDoc>
Email jh*****@pcats.org to get a copy of the schema files...

That aside, how did you want to load the data into your SQL table? An XSL is very useful for transforming the format from XML to CSV, but you may want to get the data into a .NET DataSet instead in order to save it to SQL. Another method would be to convert the data to a SQL bulk insert format, for which an XSL would be useful. What version of SQL Server are you using, and how many transactions do you expect to process?

BizTalk Utilities - Frustration free BizTalk Adapters
http://www.topxml.com/biztalkutilities
Jun 18 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

162
by: Isaac Grover | last post by:
Hi everyone, Just out of curiosity I recently pointed one of my hand-typed pages at the W3 Validator, and my hand-typed code was just ripped to shreds. Then I pointed some major sites...
6
by: Kartik | last post by:
Hello, I was trying to develop a game in c++ ( text mode ), but I couldn't figure out how to make rest of the elements moving in the game while waiting for the player's input, or, how to accept...
6
by: Danny Lesandrini | last post by:
I'm using an Access database to drive a web site and the colors of various table backgrounds are stored in Access. I want users of the Access database to be able to select colors for the site, but...
36
by: AussieRules | last post by:
Hi, I want to use the user color scheme to set the color of my forms. I now I have to use the. System.Drawing.SystemColors, but which color is the color of a form background as used in other...
3
by: RCS | last post by:
Perhaps you are familiar with the old: <nobr style="OVERFLOW:hidden;width:100px;TEXT-OVERFLOW:ellipsis">blah blah blahblah blah blah blah</nobr> technique.. Well, within a gridview, if I use...
8
by: firewood | last post by:
I am developing a form-based website development system using PHP5, and I want to incorporate a secure, reliable, Wysiwyg textarea script in place of the standard, unformatable, text-only textarea...
5
by: tony | last post by:
I'm using PHP 5 on Win-98 command line (ie no web server involved) I'm processing a large csv file and when I loop through it I can process around 275 records per second. However at around...
132
by: Frederick Gotham | last post by:
If we look at a programming language such as C++: When an updated Standard comes out, everyone adopts it and abandons the previous one. It seems though that things aren't so clear-cut in the C...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.