I need an Expert. 
July 18th, 2007, 10:22 PM
| | Newbie | | Join Date: Jul 2007
Posts: 2
| |
I have an XML that my company sends out daily it used to be created by SQL but I now have to use crystal reports and I can't seem to get it to line up the same. Please help with any references or how to rewrite my schema. I will try to provide pictures of what currently have.
(This is Mine from Crystal Reports) -
[b]<?xml version="1.0" encoding="UTF-8" ?>
-
- <BSASStockStatus xmlns="urn:crystal-reports:schemas" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:schemaLocation="urn:crystal-reports:schemas Stock_Status_Columns788.xsd">
-
- <ReportArea Level="0" Type="Report" ReportDate="">
-
- <Items Type="Header">
-
<Text>7/18/2007</Text>
-
</Items>
-
- <Item Level="1" Type="Details">
-
<strPartNumber FieldName="{STOCK.PARTNUMBER}">004-351-0</strPartNumber>
-
<strNomenclature FieldName="{STOCK.DESCRIPTN}">TIRE</strNomenclature>
-
<strQuantity FieldName="{STOCK.QTY_INSTOCK}">1.00</strQuantity>
-
<strSafetyLevel FieldName="{STOCK.MINQTYLEVEL}">0.00</strSafetyLevel>
-
<strASL FieldName="{STOCK.MAXQTYLEVEL}">1.00</strASL>
-
(This is how I need it to be) -
<?xml version="1.0" ?>
-
- <BSASStock:StockStatus xmlns:BSASStock="http://www.w3.org/2001/XMLSchema-instance" reportDate="2007-06-01" BSASStock:schemaLocation="BSAS-Stock.xsd">
-
- <Items>
-
- <item strPartNumber="01-P24481F001">
-
<strNomenclature>"POWER CONTROL PTRA200"</strNomenclature>
-
<strQuantity>"4"</strQuantity>
-
<strSafetyLevel>"3"</strSafetyLevel>
-
<strASL>"6"</strASL>
-
</item>
-
- <item strPartNumber="01-P25390B002">
-
<strNomenclature>"SATCOM REMOTE CONTROL"</strNomenclature>
-
<strQuantity>"3"</strQuantity>
-
<strSafetyLevel>"7"</strSafetyLevel>
-
<strASL>"13"</strASL>
-
</item>
-
MY SCHEMA
Original Schema - <?xml version="1.0" encoding="UTF-8" ?>
-
- <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:BSASStock="http://www.BSAS.com" targetNamespace="http://www.BSAS.com" elementFormDefault="unqualified" attributeFormDefault="unqualified">
-
- <annotation>
-
<documentation>Created as a test specification for sending of BSAS Stock Data to Army Copyright 2007 (c) BSAS - All rights reserved.</documentation>
-
</annotation>
-
<element name="StockStatus" type="BSASStock:StockStatusType" />
-
- <complexType name="StockStatusType">
-
- <sequence>
-
<element name="Items" type="BSASStock:ItemsType" />
-
</sequence>
-
<attribute name="reportDate" type="date" />
-
</complexType>
-
- <complexType name="ItemsType">
-
- <sequence>
-
- <element name="item" minOccurs="0" maxOccurs="unbounded">
-
- <complexType>
-
- <sequence>
-
<element name="strNomenclature" type="string" />
-
<element name="strQuantity" type="string" />
-
<element name="strSafetyLevel" type="string" />
-
<element name="strASL" type="string" />
-
<element name="strVendor" type="string" />
-
</sequence>
-
<attribute name="strPartNumber" type="string" />
-
</complexType>
-
</element>
-
</sequence>
-
</complexType>
-
</schema>
-
I apologize for the length this is my first time use.
Last edited by Dormilich; June 17th, 2009 at 06:35 AM.
Reason: fixed code tags
| 
July 24th, 2007, 02:40 AM
|  | Moderator | | Join Date: Nov 2006 Location: Upstate NY - US
Posts: 2,200
| | | re: I need an Expert.
I am not an expert but hope I can help you spin it in the right direction:-)
What is not working?
And why do you need to re-write your schema?
| 
June 16th, 2009, 07:16 PM
| | Newbie | | Join Date: Jun 2009
Posts: 8
| | | re: I need an Expert.
i saw this topic and i need a similiar kind of help
I have an issue where i need to parse crystal report file and convert it into XML code.
Moreover , i wish to explore as RDL in reporting services is in XML , lik wise crystal supports which language , is it html?
I need to convert that crystal report into RDL in reporting sevrices which is actually XML code.
so i basically need a parser which converts Crystal to RDL or if its not available i need some basic stuff which help me to write code or aany Program which converts cyrstal report supporting language in to XML code.
NY help would be highly appreciated!
| 
June 17th, 2009, 06:36 AM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,486
Provided Answers: 9 | | | re: I need an Expert.
what does the crystal report file look like?
| 
June 17th, 2009, 11:53 AM
| | Newbie | | Join Date: Jun 2009
Posts: 8
| | | re: I need an Expert.
Please find the attachment which shows u how the crytal report looks like.
| 
June 17th, 2009, 12:25 PM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,486
Provided Answers: 9 | | | re: I need an Expert.
the problem is to get a program reading the file… isn't in Crystal an export function to HTML or text?
| 
June 17th, 2009, 12:43 PM
| | Newbie | | Join Date: Jun 2009
Posts: 8
| | | re: I need an Expert.
Here u go ..its a html code of the attached report .....!!!
I want its XML code ,can u help?
| 
June 17th, 2009, 12:52 PM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,486
Provided Answers: 9 | | | re: I need an Expert.
ideally, they would output it in XHTML, then there would be no problem. but with a little luck this file may parse as XML (non-validating).
I could imagine reading this HTML with Javascript and saving as X(HT)ML…
| 
June 17th, 2009, 01:35 PM
| | Newbie | | Join Date: Jun 2009
Posts: 8
| | | re: I need an Expert.
this was just a demo file which i showed u.
i really need some stuff where i can convert this HTML code to XML , is there any free convertors available that you have come across ?
| 
June 17th, 2009, 01:43 PM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,486
Provided Answers: 9 | | | re: I need an Expert.
let's put it this way… if you quote all attribute values (<tr valign=top> → <tr valign="top">), add the attribute values where missing (<td nowrap> → <td nowrap="nowrap">) close all empty elements (<br> → <br/>) and prepend an XML prolog, then you have XML.
one of the most simple ways to do this is using Regular Expressions and the appropriate string replace function of your favourite script language.
Last edited by Dormilich; June 17th, 2009 at 01:47 PM.
Reason: added RegEx
| 
June 17th, 2009, 02:21 PM
| | Newbie | | Join Date: Jun 2009
Posts: 8
| | | re: I need an Expert.
yeah that s true but i want some automated function or program which does this.
| 
June 17th, 2009, 02:23 PM
|  | Moderator | | Join Date: Aug 2008 Location: Leipzig, Germany
Posts: 3,486
Provided Answers: 9 | | | re: I need an Expert.
any decent script language should be capable to do so.
it should also be not too complicated to convert the CSV output to XML.
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 225,662 network members.
|