.xml files altered when building webhelp

This forum is for all Flare issues related to styles, stylesheets and XML.
DocNiNjA
Jr. Propeller Head
Posts: 9
Joined: Thu Mar 01, 2007 7:18 am
Location: Boston, MA

.xml files altered when building webhelp

Post by DocNiNjA »

I have an XML file (source.xml), and I'm using Javascript to pull information from the XML file and display it in various Flare topics. This works just fine for CHM output, but the source.xml file gets mangled when I build WebHelp output. Looks like Flare is trying to make it into a browser-friendly topic rather than a strict data source :roll:...

Anyone have ideas on how to get this XML file through the WebHelp build process unscathed?

Thanks!
Jumping over an office building near you.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Post by LTinker68 »

Maybe you need to add the MadCap xmlns tag to the beginning of the XML file???
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Tydalian
Propeller Head
Posts: 12
Joined: Tue Sep 12, 2006 1:01 pm
Location: New Hampshire

.xml files altered when building webhelp

Post by Tydalian »

On the same track, I have noticed that the comment line I have added to top of the file:

<!-- Copyright 2006-2007 by ActiVia Networks, Inc. All Rights Reserved. -->

is missing after the compile. My output files do not contain my copyright statement.

I have located the comment line below the xml version statement:

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!-- Copyright 2006-2007 by ActiVia Networks, Inc. All Rights Reserved. -->
<html xmlns:MadCap=\"http://www.madcapsoftware.com/Schemas/MadCap.xsd\">

Perhaps I need to place it in a specific place to keep it in? Where should I put it? I tried moving it into the <html> section, but that didn't do it...

Thanks in advance...Kim
NorthEast
Master Propellus Maximus
Posts: 6374
Joined: Mon Mar 05, 2007 8:33 am

For the copyright question...

Post by NorthEast »

are you adding it to the individual files or the master page?

Stuff I've added to my master pages is usually left intact.
DocNiNjA
Jr. Propeller Head
Posts: 9
Joined: Thu Mar 01, 2007 7:18 am
Location: Boston, MA

re: .xml files altered when building webhelp

Post by DocNiNjA »

The namespace is included in the XML file. Before I compile, the code looks like this:

Code: Select all

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<catalog class=\"\" MadCap:conditionTagExpression=\"\" xmlns:MadCap=\"http://www.madcapsoftware.com/Schemas/MadCap.xsd\">
    <cd><title>Pause</title>
        <artist>Four Tet</artist>
        <country>USA</country>
        <company>Domino Records</company>
        <price>12.95</price>
        <year>2001</year>
    </cd>
    <cd><title>Oh, Inverted World</title>
        <artist>The Shins</artist>
        <country>USA</country>
        <company>Sub Pop</company>
        <price>14.95</price>
        <year>2001</year>
    </cd>
    <cd><title>Takk...</title>
        <artist>Sigur Ros</artist>
        <country>Iceland</country>
        <company>Geffen</company>
        <price>14.95</price>
        <year>2005</year>
    </cd>
</catalog>
After I compile, I get:

Code: Select all

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<html xmlns:MadCap=\"http://www.madcapsoftware.com/Schemas/MadCap.xsd\" MadCap:tocPath=\"\" class=\"\">
    <head><title>Pause</title>
        <link href=\"../../SkinSupport/MadCap.css\" rel=\"stylesheet\" />
        <link href=\"../Stylesheets/Styles.css\" rel=\"stylesheet\" />
        <script src=\"../../SkinSupport/MadCapUtilities.js\"> <![CDATA[ ]]></script>
        <script src=\"../../SkinSupport/MadCapBody.js\"> <![CDATA[ ]]></script>
        <script src=\"../../SkinSupport/MadCapHighlighter.js\"> <![CDATA[ ]]></script>
    </head>
    <body>
        <div class=\"MCBreadcrumbsBox\"><span class=\"MCBreadcrumbsPrefix\">You are here: </span><span class=\"MCBreadcrumbs\">Pause</span>
        </div>
        <MadCap:bodyProxy />
        <p> </p>
        <div class=\"Footer\"><span class=\"Copyright\">Copyright © 2007. All rights reserved.</span>
        </div>
        <script type=\"text/javascript\" src=\"../../SkinSupport/MadCapBodyEnd.js\">
        </script>
    </body>
</html>
Totally baffling.
Jumping over an office building near you.
Tydalian
Propeller Head
Posts: 12
Joined: Tue Sep 12, 2006 1:01 pm
Location: New Hampshire

For the copyright question...

Post by Tydalian »

are you adding it to the individual files or the master page?

Stuff I've added to my master pages is usually left intact.

I have a copyright symbol and link that appear on all topics via Master pages, visible in the help when open. But this does not appear in my html files...the raw code files. So I added the line in my original post...but that disappears after the compile.

Is there any way tp include a comment line that remains in the compiled file? Where should I put it?

Thanks...Kim
NorthEast
Master Propellus Maximus
Posts: 6374
Joined: Mon Mar 05, 2007 8:33 am

I can include that copyright without any problem.

Post by NorthEast »

I put this in my master page and it worked fine - it appeared in the output HTM files.

Code: Select all

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<!-- Copyright 2006-2007 by ActiVia Networks, Inc. All Rights Reserved. -->
<html xmlns:MadCap=\"http://www.madcapsof...

Just to check, you have selected the master page for the target you're generating? (i.e. selected it on the target's 'Advanced' tab)
Tydalian
Propeller Head
Posts: 12
Joined: Tue Sep 12, 2006 1:01 pm
Location: New Hampshire

I can include that copyright without any problem.

Post by Tydalian »

Hmmm...are we talking about the same thing? (Great!! if we are...)

I want to have a notice of copyright and ownership in each of the raw xml files I deliver in a web help system for my client. So I added a comment line to the topic template I use, thinking it would stay in the compiled topics I deliver as webhelp. I also have a copyright notice on the visible topic pages in the finished help system, which I added through a master page object at the bottom of all topic pages.

It is the comment line that disappears for me in the raw xml file.

If you included my line (as shown in your post above) into the raw xml file using the internal editor (or other code editor) and it appears just like that in the raw output files...not in the visible help topics, but in each of the hundreds of output files in a web help system, then I am doing something wrong and will gladly try your solution! To check, simply open one file using Notepad...not a browser...and check if the comment line remains in the raw xml code. Mine doesn't remain after the compile.

I don't believe there is a connection to master pages here. The raw xml topics are based on template files. So...are we talking the same thing?

Thanks...Kim
Tydalian
Propeller Head
Posts: 12
Joined: Tue Sep 12, 2006 1:01 pm
Location: New Hampshire

I can include that copyright without any problem.

Post by Tydalian »

Madcap - Could you weigh in on this, please?

Can a comment line survive the compile? If so, where does it need to go in the input file to survive? If not, is it already on the list for improvements in future releases?

Thanks...Kim
NorthEast
Master Propellus Maximus
Posts: 6374
Joined: Mon Mar 05, 2007 8:33 am

I was talking about topics (HTM files), not XML files.

Post by NorthEast »

I thought you were including this copyright comment to topics (not XML files), as you mentioned adding it above the HTML tag, which wouldn't be in your XML files.
My post was about adding the copyright comment to the master page, which will include it on all your topics - i.e. the HTM files in the output.

I'm not sure what Flare does to your raw XML files, but from what you say it seems to modify them and make a bit of a mess.
If that's the case, it might be better not to include them in your Flare project, and just copy them in after a build.
Richard Ferrell
Propellus Maximus
Posts: 840
Joined: Mon May 01, 2006 10:11 am
Location: Inside California

Post by Richard Ferrell »

Dave Lee is right, you would want to add it your HTML files and not the XML files, I will add this as a feature request
Richard Ferrell

Certified Madcap Trainer
Image
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

let's get back to the original question here

Post by tputkey »

The original question that DocNiNjA asked was that Flare SCREWS up the XML once you produce webhelp.

I'm having this problem too and so far the answer I've received from Flare tech support:
The reason this is occuring is becasue Most of your topics are XML files, In your Content Explorer go to the DocumentFields folder and then notice that most of these files are ending in XML. These files can not be read by a browser, That is why you are seeing the error. Most browsers can not handle a XML file, it needs to be a htm File. You will need to find some way to change those files to HTML files.
I believe that this is poppycock and have told the support team. I'm hoping that they come back with a better answer. I can display the XML files in IE outside of the WebHelp, but once the WebHelp is produced, IE can no longer display the XML files.

I don't want to keep my files outside of my Flare project and I don't want to have to do anything after I build the files. I want Flare not to put junk in my XML trunk. :!:
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
Kleb
Propeller Head
Posts: 16
Joined: Tue Aug 28, 2007 3:25 pm

Post by Kleb »

Probably Flare is running the source files (xml, xhtml, htm, html) through an xsl transform and the one for the webhelp target defaults to adding missing code to make the file \"readable\".

Like tputkey said, .xml files are readable by IE. You can put a link to an xsl stylesheet in the xml file that will transform the xml into a webpage and IE will display it correctly.

Flare needs the ability to exclude certain source files from the processing/compilation process and simply copy them to the target. We had a problem with this where the javascript in a redirect file we use for a merged CHM system got disabled when it went through compile.
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

follow up to the XML

Post by tputkey »

I got this response from the support team:
You are correct, the files are being changed by Flare, Flare see the xml files and is trying to make them Valid xhtml and is changing your text if files. I have logged this with our developers to give you the option not to modify XML files that are not topics. If this is done in a future version of Flare you will be notified.

As a Workaround you can copy the XML files from your Content Directory int your output file, this will work as Flare will not have touched the files.
This kind of sucks as Flare is meant to be a content management system. By not being able to host non-html files, it defeats the purpose of the product. I have to keep my XML files outside of the project and when I compile, I then have to copy these XML files into the compiled directory.

So, I need to updated my help project with links to XML files outside the help. I can't put the XML references in the TOC. Then, when the feature is available to host XML files, I have to change my help system again.

Considering that I have 150 XML files plus references throughout my SDK, it's no small task to work around this issue.
I'm somewhat disappointed with the Flare handling of XML files. It seems like it would go without saying that you wouldn't want certain files to be marked up.
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
NorthEast
Master Propellus Maximus
Posts: 6374
Joined: Mon Mar 05, 2007 8:33 am

Change the .xml file extension?

Post by NorthEast »

Flare modifies XML files with a .xml extension, but it will leave files alone if they have a different file extension.
I tested this by changing the extension of a XML file and it was included in the target unmodified.

Would your system work using different filename extensions to .xml?
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

which file extention to use?

Post by tputkey »

If I didn't use the extension .XML, what file extension would I use?
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Post by doc_guy »

Which XML files are you referring to? All my topic files are .htm or .html source files. They get processed by the Flare output handler and I get resulting .htm or .html files.

The only .xml files in my source are:

RecentImages.xml
RecentSnippets.xml
ConditionTagExpressions.xml

There are several XML files in my output files, but these are mostly related to Search files, or they are files that were in the DATA folder with a different extension. (But you can't just copy the files in your data folder; processing happens before these extensions are changed. For example, the MyAliasFile.flali file is combined with the header.h file to get the alias.xml file in the output.)

So I'm not sure what .xml files you are modifying that you want to add your comment to. Those files don't exist in any of my projects, as far as I can tell.
Paul Pehrson
My Blog

Image
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

non-project XML files

Post by tputkey »

Hi,
I've got non-project XML files. These are files that the developers gave to me, produced by visual studio, that I'm incorporating into the project. They're formatted with their own XSL and CSS.

If i have them in the content folder, then they're messed up. If I don't have them in the content folder, they're not messed up but I have to copy them over when I do a compile. This isn't ideal as our publishing process is supposed to be automatic.
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Post by LTinker68 »

If you're not accessing the XML files from within Flare (and therefore it won't try to add its own schema code to the top of the page), then try creating a folder inside the Resources folder. I don't think the Resources folder is processed the same way that the topic files are processed. As a test, I created a \"SupportFiles\" folder inside the Resources folder and inserted a plain text .txt file into the folder. Both the .txt file and the \"SupportFiles\" folder made it into the output folder. I don't have an XML file with its own XSL and CSS, so you'll have to test it yourself, but that might work. No guarantees, because Flare might still try to process the file even though it's in the Resources folder, but give it a shot and let us know if it works.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

thanks!

Post by tputkey »

I'll definitely try that this week and let you know! Hopefully that will work, would save a step after the project has been compiled.

Cheers,
Theresa
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
tputkey
Propeller Head
Posts: 25
Joined: Tue Jul 24, 2007 12:52 pm
Location: Vancouver, BC

resources folder doesn't work

Post by tputkey »

I tried putting the XML files in the Content>Resources folder, but the build process still messes them up. The only success I've had is having the structure as:
Help Project\\Content
Help Project\\XML Files

When I had:
Help Project\\Content\\XML Files
or
Help Project\\Content\\Resources\\XML Files
the XML files could not be opened in the WebHelp.
Theresa Putkey
Key Pointe Usability Consulting, Inc
Information Architecture, Content Planning and Writing
"Organizing your information. Writing to your key pointes."
Vancouver, BC, Canada
DocNiNjA
Jr. Propeller Head
Posts: 9
Joined: Thu Mar 01, 2007 7:18 am
Location: Boston, MA

Post by DocNiNjA »

Theresa -

I was finally able to get my XML files through the Flare build process unaltered. The key is to make sure no master pages are assigned to the target you're building (i.e. select (default) as the Master Page). You shouldn't need to change the file extensions or store the files in the resources folder.

You can still use master pages with your project, but you need to apply them in your style sheet rather than applying them to a target output. You just need to add a definition like:

Code: Select all

html
{
  mc-master-page: url('../../MasterPages/YourMasterPage.flmsp')
}
Once I made this change, my XML has been fine.

Now for the next frontier ... once you have XML/JS running correctly and pulling dynamic content into Help topics, how do you get that content to appear in Flare's search results? So far I haven't made any progress on this front ...

Hope this is helpful,

-Ryan
Jumping over an office building near you.
APieceOfTheMosaic
Jr. Propeller Head
Posts: 1
Joined: Mon Feb 18, 2008 5:00 pm

Re: .xml files altered when building webhelp

Post by APieceOfTheMosaic »

My xml data files were being altered as well and I tried all the workarounds listed here but none of them worked. Finally, I tried adding my own xmlns and then they were left alone.

Code: Select all

<anxmltag xmlns:xyz="http://www.yourwebsite.com">
     <anothertag>blah blah blah</anothertag>
     <anothertag>yadda yadda</anothertag>
     <anothertag>etc. and so on</anothertag>
     ...
</anxmltag>
It appears that if a file does not have a declared xmlns to begin with, Flare will insert the default MadCap xmlns itself during the packaging process. Then later in the same process it will 'see' the xml file that it added the xmlns to and proceed to alter the file further using the default topic template to make it xhtml compliant.

This worked with WebHelpPlus as the target. I haven't tried it with any other target, but I wouldn't expect it to be different.
Unfortunately, I must have done something else to cause it to skip over the xml files and now I can't figure it out. Yesterday I was publishing all day without it altering my xml data and then today I published and now they're all changed. Sorry! I even tried creating and attaching a schema to my xml data files, but Flare ignores the schema. Still working on it.


T
Last edited by APieceOfTheMosaic on Thu Feb 21, 2008 11:59 am, edited 1 time in total.
RamonS
Senior Propellus Maximus
Posts: 4293
Joined: Thu Feb 02, 2006 9:29 am
Location: The Electric City

Re: .xml files altered when building webhelp

Post by RamonS »

Welcome to the forums and thanks for the helpful post!
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: .xml files altered when building webhelp

Post by doc_guy »

Welcome to the forums! Maybe you should re-package this idea and post it to the tips and tricks forum!
Paul Pehrson
My Blog

Image
Post Reply