Jump to content

MyronCope

Members
  • Posts

    7
  • Joined

  • Last visited

MyronCope's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I am trying to write a script to insert more than one column but the script I am making only inserts the column in the second line and I dont know why. In my code below, columnB is added to the table, but not columnA. I am stumpedMy sql is: Alter table [dbName].[dbo].[tableName] Add columnA bit Default 0 Not NullAlter table [dbName].[dbo].[tableName] Add columnB bit Default 0 Not Null thanks for your help.
  2. I am trying to write a script to insert more than one column but the script I am making only inserts the column in the second line and I dont know why. In my code below, columnB is added to the table, but not columnA. I am stumpedMy sql is:<CODE>Alter table [dbName].[dbo].[tableName] Add columnA bit Default 0 Not NullAlter table [dbName].[dbo].[tableName] Add columnB bit Default 0 Not Null</CODE>thanks for your help.
  3. I found that these hex chars appear to be the BOM Byte Order Mark, hidden chars that are included in an xml file and for some reason Java cannot deal with these chars (seems to be a bug in the Java language). So it looks like I will have to find a way in my vb.net code to read the xml file and replace the BOM characters when I see them.If anyone has done this before let me know.
  4. Hi all,I have a program that is taking several xml documents, loading them with vb.net code and creating one master xml document. Next, I'm taking this master xml document and with the help of xsl I am creating a transformed xml document (which I will call transform.xml).We are taking transform.xml and submitting it to an online publication site. This online site first parses transform.xml and then if all looks good then submits the document into their system. Transform.xml parses well except for one problem:There are hidden hexadecimal characters that are somehow placed before the first opening element (before the first "<"). They are hidden in the sense that you cannot see these characters but if you use hex viewing or parsing software then you can view these characters.I'm not sure how these characters are being placed there but I would like to try to figure out how to avoid this. The characters are:Hex: EF BB BFDec: 239 187 191i >> (upside-down question mark)When I open result.xml and then save it these characters go away, but I'm trying to avoid this manual step so that the process is more automated. It looks like there is some formatting in the original xml documents that I load in my vb.net and my guess is that this is somehow being copied into hex, but this is only a guess.My question is, has anyone come across this or have any insight into how I can avoid this, either in the Vb.net code or xsl? Any feedback appreciated. Let me know if you need to see code or xsl.
  5. Think I figured it out:1. (dont know if this was related or not)I needed </xsl:stylesheet> near end of xsl (was missing "xsl")2. Needed this line near top of xsl:<code><xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema"><code>Looking better now but might have follow-up questions...
  6. Thanks for your fast response.Answers to your questions:1. No. the root node of the original is: <asset>2. No. I would like to replace pretty much all of the fields. the new xml document structure and content is much different from the original but the new one does derive fields from the original. The new xml document that I have to create is much more complex and can go up to 7 nodes deep at times. The original goes a max 3 nodes deep. (general idea):Original.xml<code> <?xml version.....> <asset id="99999"> <coreData> <expireDate> <![CDATA[]]> </expireDate> <deployPath> <![CDATA[folder/magazine/magname/vol22/1001102.asp]]> <deployPath> . . . </coreData> <metaData> //same idea as above </metaData> <content> //again, same general idea as coreData </content> </asset></code>I need to transform the original xml file into something that looks like the following:<code> <?xml.....><doi_batch....> <head> <id>8900900</id> ..... ..... </head> <body> <Magazine> <mag_metadata language="en"> <title>Magazine Name</title> ..... </mag_metadata> <journal_issue> <Year>2001</year> <issue>22</issue> </journal_issue> .... </Magazine> </body></doi_batch></code>Thanks in advance.
  7. Hi,i'm trying to convert one xml doc to a new xml doc using xml style sheet (.xsl) and I'm calling the xsl from my vb.net code but getting the following runtime exception:<code>xml readfailed.xml.xmlexception: 'xsl' is an undeclared namespace, line 2...</code>the xsl code follows:<code><?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/expireDate"> <doi_batch></doi_batch> </xsl:template></stylesheet></code>In my new xml file I want to replace "expireDate" element with "doi_batch" but since I have not done this before it's apparent that my syntax is off. To be clear: I"m not trying to display anything, just want to convert one xml document to another and change many of the element names and much of the content.Thanks in advance for the help.
×
×
  • Create New...