|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Required Tags Disappear??
OK I am newbie to XML but not to programming. I was assigned the task of trying to develop some why for my company to file UCC's for NY State through an automated XML filing system (of course figuring out XML first
).Here is a link to their DTD --> URL I decided to use XML Spy as it seemed relatively easy to figure out plus I could create a stylesheet so that they people that are going to use this could easily imput data without having to know anything about XML (this is really a must). Anyways I got everything created OK, or so I thought, as the filings are basically split into 2 sections (1) Header and (2) Record(s). If I just do 1 record for one file, everything goes as planned but if I try to put more than one record in one file, it seems as if mandatory tags are not copied to the new record. Basically the <OrganizationName> does not show up on the 2nd Record unless I input it. This poses a problem as there will be parts of the DTD that is not entered such as <FileInRealEstate> but as it includes the <Names> tag which should include <OrganizationName> but it leaves that tag out which causes this XML file to be invalid. Has anyone run across this? I am sure I did something wrong but as I have not ever done this before I am not sure where to look. |
|
#2
|
|||
|
|||
|
Can you post 1: some sample input, 2: your xsl stylesheet, and 3: some sample output so we can see what's not working right?
|
|
#3
|
|||
|
|||
|
Thanks for you help and I will attach a zip file to save some space on here that includes the following files:
stylesheet.sps --> the stylesheet good.xml --> a valid version of the xml document bad.xml --> this is what good.xml looked like before I went in a made the changes manually to get it to work right. Not every field has to be filled in which is part of the problem. I was going to try to do a workaround and put the fields that will not be filled in (like FillInRealEstate) at the bottom of the style sheet so that they can put a blank line in there and then I am hoping it will include <OrganizationName>. Anyways, thanks for trying to help me out. The DTD is on the internet if you want to see it. Last edited by cfields : July 8th, 2003 at 09:12 AM. |
|
#4
|
|||
|
|||
|
Well, first off, I've never used XMLSpy, so I'm guessing that the .sps file you sent generates a form that people can enter data into and then have that data magically spit out as XML?
I noticed a few things about the .sps file, though. First, I can't find anywhere that you're generating an AuthDebtor tag. This suggests that maybe the .sps file is grabbing an empty value out of the .dtd or something. Second, you've got two templates that are doing almost identical operations on the Record tag. The structure looks something like this: Code:
<template>
<template (matches Document)>
<template (matches Record)/>
</template>
<template (matches Record)/>
</template>
This would seem to me that you're generating two snippets of XML for every set of data entered. Either that, or the first record you enter is getting processed by the first template, and subsequent records are getting processed by the second. That would explain the data discrepancy. Also, what it appears is happening with your data is that since no values are being entered in the form, XMLSpy is just outputting an empty tag. That would mean it's leaving off any empty child tags as well. You want to go ask your question here: http://www.altova.com/forum/forums/forum.asp?forumid=26 I would assume they'd be able to give you more targetted help with this. |
|
#5
|
|||
|
|||
|
Ok thanks for your help..
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Required Tags Disappear?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|