imatix / gsl

iMatix GSL code generator
http://www.imatix.com
GNU General Public License v3.0
539 stars 107 forks source link

Help: how to split xml file in two #104

Closed drozzy closed 9 years ago

drozzy commented 9 years ago

Update: My example is here https://bitbucket.org/drozdyuk/fruits-sample/src

I am trying to create a "static" site (this is following the tutorial in the guide). Here is what xml looks like right now.

<?xml version = "1.0" ?>

<site 
  copyright = "Copyright &#169; Local Grocer"
  script = "sitegen.gsl"
  >

<page name = "home" />
<page name = "videos" />
<page name = "bio" />

<link icon="facebook" name="Facebook" url = "http://www.facebook.com/blah" />
<link icon="camera" name="Youtube" url = "http://www.youtube.com/user/blah" />
<link icon="film" name="Picasa" url = "http://picasaweb.google.com/323423" />
<link icon="twitter" name="Twiter" url = "http://twitter.com/blah" />

</site>

However, I want to take out the "links" into a separate xml file, and I can't figure out how! I tried everything from "xml to site from "links.xml"" to "xml . load_file(links.xml)" --- the closest I came to a solution was only the FIRST link was showing up in the final markup.... Am I missing something?

For the life of me I can't figure it out, and don't know where to ask for help (stackoverflow gsl tag is not what I need).

hintjens commented 9 years ago

Post your example GSL and XML code somewhere (a gist) and someone may help you.

On Tue, Sep 15, 2015 at 12:09 AM, drozzy notifications@github.com wrote:

I am trying to create a "static" site (this is following the tutorial in the guide). Here is what xml looks like right now.


copyright = "Copyright © Local Grocer"
script = "sitegen.gsl"

However, I want to take out the "links" into a separate xml file, and I can't figure out how! I tried everything from "xml to site from "links.xml"" to "xml . load_file(links.xml)" --- the closest I came to a solution was only the FIRST link was showing up in the final markup.... Am I missing something?

For the life of me I can't figure it out, and don't know where to ask for help (stackoverflow gsl tag is not what I need).

— Reply to this email directly or view it on GitHub https://github.com/imatix/gsl/issues/104.

drozzy commented 9 years ago

Ok, I've bundled it up as a small git project here: https://bitbucket.org/drozdyuk/fruits-sample/src

The two files of interest are sitegen.gsl - where I try to load the "links.xml": https://bitbucket.org/drozdyuk/fruits-sample/src/07efb4910bde9bf080117e6382fdf921780610d5/sitegen.gsl?at=master&fileviewer=file-view-default

and the template.gsl where I iterate through "links" and try to display them: https://bitbucket.org/drozdyuk/fruits-sample/src/07efb4910bde9bf080117e6382fdf921780610d5/template.gsl?at=master&fileviewer=file-view-default

Nothing shows up... the links are not even in the root.xml dump.

drozzy commented 9 years ago

I've asked this on stackoverflow: http://stackoverflow.com/questions/32593058/how-to-include-another-xml-file

So please answer over there!

Not sure why there wasn't a tag for gsl yet! Seems like a nifty tool.

hintjens commented 9 years ago

I answered on the StackExchange site.

On Tue, Sep 15, 2015 at 8:27 PM, drozzy notifications@github.com wrote:

Closed #104 https://github.com/imatix/gsl/issues/104.

— Reply to this email directly or view it on GitHub https://github.com/imatix/gsl/issues/104#event-410121000.