Stack/Card XML? Stackimport schema for OXT?

Organizing tasks to work on, New Features Ideas, Building LCS & LCB Libraries & Widgets, Redecorating and Modifying the IDE, Hacking / Editing Tools, Compiling the Engine from Source, etc.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

I was just reading up on StackSmith some more and then downloaded (and compiled with little issue from source) the command line tool that was originally developed for OpenXION, which outputs in a format used by in StackSmith, from converted HyperCard stacks. It mostly outputs XML along with parsed info and resources such as bpm formatted bitmaps (there's also a SNDtoWAV CLI used for converting sounds!). I was thinking this, or some XML scheme like it that could be devised from scratch (although personally I'd want to be at least compatible with this if possible), could be used for our IDE's content, like to generate stacks from XML complete with graphics, sounds, etc. in place. for instance.

I was also reading up on XMP which was originally Adobe product but is now a official W3C open standard under Apache foundation, it's for tagging media assets with any sort of useful data, such as Resource Description Framework Model (RDF), for media content management like to give meaningful description of the content or perhaps the content object's properties: height and width, pixel depth, resolution, etc. XMP can be found in use in certain PDF workflows in print production for job tracking, including specification of print parameters such as step and repeat grid for printing plate layouts for example ;-)

All of this reading up happens to fall right in with the discussion about the rebuilding of the IDE's ResourceCenter stack.
We could use some XML format to make an index stack that builds most of itself from stack.xml data in a subdirectory, along with preview images and of course the actual stack(s) themselves. Then you browse them in the index stack and launch (go to stack...) the ones that interest you from this index. We would have a main category covering basics, but we could have some other categories as well, coustom content from other locations could be pulled into the generated index as well and listed along with whatever pre-installed content. You would have in your IDE user's customization folder (~/My OpenXTfalk directory) a folder called ResourceCenter that you could add stacks to, perhaps, via a new content package manager stack, those stacks and meta data get downloaded from some online repository of ResourceCenter stacks residing on GitHub.

This some of the XML for HyperCard's Home stack as spit out by StackImport, with a bunch of other files, mostly more xml, one CSS with Font info, PATs, raw bitmaps, and other raw data.

Code: Select all

xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
	<name>Resources.stak</name>
	<id>-1</id>
	<cardCount>10</cardCount>
	<cardID>2992</cardID>
	<listID>5972</listID>
	<cantModify><false /></cantModify>
	<cantDelete><false /></cantDelete>
	<cantAbort><false /></cantAbort>
	<cardSize>
		<width>480</width>
		<height>296</height>
	</cardSize>
	<script>∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
What is HyperCard?
Version 2.3

©Copyright 1993-1995 by Apple Computer,Inc.
All Rights Reserved.

Created by Instructional Products at Apple Computer, Inc.
Vers. 1.0 by Pat Chaney, Eli Cochran, Pete Harbeson, and Sarah McGranaghan
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞

-- S T A C K  S C R I P T
-- THE SCRIPTS FOR THIS STACK ARE IN THE BACKGROUND SCRIPT AND
-- SOME OF THE BACKGROUND OBJECTS</script>
	<background id="2619" file="background_2619.xml" name="Content" />
	<card id="2992" file="card_2992.xml" marked="false" name="Welcome" owner="2619" />
	<card id="4222" file="card_4222.xml" marked="false" name="Introduction" owner="2619" />
	<card id="4745" file="card_4745.xml" marked="false" name="HyperCard" owner="2619" />
	<card id="4950" file="card_4950.xml" marked="false" name="Stacks" owner="2619" />
	<card id="5244" file="card_5244.xml" marked="false" name="Cards" owner="2619" />
	<card id="5608" file="card_5608.xml" marked="false" name="Buttons" owner="2619" />
	<card id="5738" file="card_5738.xml" marked="false" name="Home" owner="2619" />
	<card id="7374" file="card_7374.xml" marked="false" name="More Stacks" owner="2619" />
	<card id="6220" file="card_6220.xml" marked="false" name="Creating Stacks" owner="2619" />
	<card id="6449" file="card_6449.xml" marked="false" name="What's Next" owner="2619" />
</stack>
The XML for the one of cards:

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE card PUBLIC "-//Apple, Inc.//DTD card V 2.0//EN" "" >
<card>
	<id>6449</id>
	<filler1>0</filler1>
	<bitmap>BMAP_7989.pbm</bitmap>
	<cantDelete> <false /> </cantDelete>
	<showPict> <true /> </showPict>
	<dontSearch> <false /> </dontSearch>
	<owner>2619</owner>
	<link rel="stylesheet" type="text/css" href="stylesheet_3241.css" />
	<part>
		<id>2</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>284</left>
			<top>265</top>
			<right>314</right>
			<bottom>291</bottom>
		</rect>
		<style>opaque</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>0</family>
		<titleWidth>0</titleWidth>
		<icon>10381</icon>
		<textAlign>center</textAlign>
		<font>Chicago</font>
		<textSize>12</textSize>
		<textStyle>plain</textStyle>
		<name>Next</name>
		<script>on mouseUp
go Home
end mouseUp</script>
	</part>
	<content>
		<layer>background</layer>
		<id>24</id>
		<text><span class="style1">hat's Next

</span><span class="style2">You’re ready to start exploring HyperCard stacks! 

Your Home stack is a good place to start exploring. 
To go Home, click the Home button at the bottom of this card.

If you want to stop using HyperCard for now, choose Quit HyperCard from the File menu.</span></text>
	</content>
	<content>
		<layer>background</layer>
		<id>26</id>
		<text>What's Next

You’re ready to start exploring HyperCard stacks! 

Your Home stack is a good place to start exploring. 
To go Home, click the Home button at the bottom of this card.

If you want to stop using HyperCard for now, choose Quit HyperCard from the File menu.</text>
	</content>
	<name>What's Next</name>
	<script></script>
</card>
The CSS file is just parsed out from the stack the Fonts blobs of fonts used in the stack

Code: Select all

		.style1
		{
			font-weight: bold;
		}
		.style2
		{
		}
		.style4
		{
			font-family: "Palatino";
			font-size: 14pt;
		}
		.style5
		{
			font-family: "Geneva";
			font-size: 12pt;
		}
A card background (which is group with background behavior in LCC/OXT)

Code: Select all

<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE background PUBLIC "-//Apple, Inc.//DTD background V 2.0//EN" "" >
<background>
	<id>2619</id>
	<filler1>0</filler1>
	<bitmap>BMAP_4001.pbm</bitmap>
	<cantDelete> <false /> </cantDelete>
	<showPict> <true /> </showPict>
	<dontSearch> <false /> </dontSearch>
	<link rel="stylesheet" type="text/css" href="stylesheet_3241.css" />
	<part>
		<id>24</id>
		<type>field</type>
		<visible> <false /> </visible>
		<dontWrap> <false /> </dontWrap>
		<dontSearch> <false /> </dontSearch>
		<sharedText> <false /> </sharedText>
		<fixedLineHeight> <false /> </fixedLineHeight>
		<autoTab> <false /> </autoTab>
		<lockText> <true /> </lockText>
		<rect>
			<left>121</left>
			<top>3</top>
			<right>477</right>
			<bottom>262</bottom>
		</rect>
		<style>transparent</style>
		<autoSelect> <false /> </autoSelect>
		<showLines> <false /> </showLines>
		<wideMargins> <true /> </wideMargins>
		<multipleLines> <false /> </multipleLines>
		<reservedFamily> 0 </reservedFamily>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>left</textAlign>
		<font>Palatino</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<textHeight>18</textHeight>
		<name>Body Player</name>
		<script></script>
	</part>
	<part>
		<id>1</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>6</top>
			<right>114</right>
			<bottom>28</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <true /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Welcome</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>4</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>32</top>
			<right>114</right>
			<bottom>54</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Introduction</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>13</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>58</top>
			<right>114</right>
			<bottom>80</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>HyperCard</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>14</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>240</top>
			<right>114</right>
			<bottom>262</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>What's Next</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>15</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>84</top>
			<right>114</right>
			<bottom>106</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Stacks</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>16</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>110</top>
			<right>114</right>
			<bottom>132</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Cards</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>17</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>136</top>
			<right>114</right>
			<bottom>158</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Buttons</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>18</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>162</top>
			<right>114</right>
			<bottom>184</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Home</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>19</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>188</top>
			<right>114</right>
			<bottom>210</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>More Stacks</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>20</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>6</left>
			<top>214</top>
			<right>114</right>
			<bottom>236</bottom>
		</rect>
		<style>transparent</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>1</family>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>N Helvetica Narrow</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<name>Creating Stacks</name>
		<script>on mouseUp
goTopic
end mouseUp
</script>
	</part>
	<part>
		<id>21</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <false /> </enabled>
		<rect>
			<left>124</left>
			<top>266</top>
			<right>152</right>
			<bottom>290</bottom>
		</rect>
		<style>opaque</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>0</family>
		<titleWidth>0</titleWidth>
		<icon>19858</icon>
		<textAlign>center</textAlign>
		<font>Chicago</font>
		<textSize>12</textSize>
		<textStyle>plain</textStyle>
		<name>Previous</name>
		<script>on mouseUp
goPrev
end mouseUp

on goPrev
go previous card
end goPrev</script>
	</part>
	<part>
		<id>22</id>
		<type>button</type>
		<visible> <true /> </visible>
		<reserved5> 0 </reserved5>
		<reserved4> 0 </reserved4>
		<reserved3> 0 </reserved3>
		<reserved2> 0 </reserved2>
		<reserved1> 0 </reserved1>
		<enabled> <true /> </enabled>
		<rect>
			<left>446</left>
			<top>266</top>
			<right>474</right>
			<bottom>290</bottom>
		</rect>
		<style>opaque</style>
		<showName> <false /> </showName>
		<highlight> <false /> </highlight>
		<autoHighlight> <true /> </autoHighlight>
		<sharedHighlight> <true /> </sharedHighlight>
		<family>0</family>
		<titleWidth>0</titleWidth>
		<icon>30394</icon>
		<textAlign>center</textAlign>
		<font>Chicago</font>
		<textSize>12</textSize>
		<textStyle>plain</textStyle>
		<name>Next</name>
		<script>on mouseUp
goNext
end mouseUp

on goNext
go next card
end goNext</script>
	</part>
	<part>
		<id>26</id>
		<type>field</type>
		<visible> <true /> </visible>
		<dontWrap> <false /> </dontWrap>
		<dontSearch> <false /> </dontSearch>
		<sharedText> <false /> </sharedText>
		<fixedLineHeight> <false /> </fixedLineHeight>
		<autoTab> <false /> </autoTab>
		<lockText> <true /> </lockText>
		<rect>
			<left>121</left>
			<top>3</top>
			<right>477</right>
			<bottom>262</bottom>
		</rect>
		<style>transparent</style>
		<autoSelect> <false /> </autoSelect>
		<showLines> <false /> </showLines>
		<wideMargins> <true /> </wideMargins>
		<multipleLines> <false /> </multipleLines>
		<reservedFamily> 0 </reservedFamily>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>left</textAlign>
		<font>Palatino</font>
		<textSize>14</textSize>
		<textStyle>plain</textStyle>
		<textHeight>18</textHeight>
		<name>Body Dev</name>
		<script></script>
	</part>
	<part>
		<id>25</id>
		<type>field</type>
		<visible> <true /> </visible>
		<dontWrap> <false /> </dontWrap>
		<dontSearch> <false /> </dontSearch>
		<sharedText> <false /> </sharedText>
		<fixedLineHeight> <false /> </fixedLineHeight>
		<autoTab> <false /> </autoTab>
		<lockText> <true /> </lockText>
		<rect>
			<left>121</left>
			<top>199</top>
			<right>477</right>
			<bottom>257</bottom>
		</rect>
		<style>transparent</style>
		<autoSelect> <false /> </autoSelect>
		<showLines> <false /> </showLines>
		<wideMargins> <true /> </wideMargins>
		<multipleLines> <false /> </multipleLines>
		<reservedFamily> 0 </reservedFamily>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>Helvetica</font>
		<textSize>12</textSize>
		<textStyle>plain</textStyle>
		<textHeight>16</textHeight>
		<name>Tag Dev</name>
		<script></script>
	</part>
	<part>
		<id>27</id>
		<type>field</type>
		<visible> <false /> </visible>
		<dontWrap> <false /> </dontWrap>
		<dontSearch> <false /> </dontSearch>
		<sharedText> <false /> </sharedText>
		<fixedLineHeight> <false /> </fixedLineHeight>
		<autoTab> <false /> </autoTab>
		<lockText> <true /> </lockText>
		<rect>
			<left>121</left>
			<top>199</top>
			<right>477</right>
			<bottom>257</bottom>
		</rect>
		<style>transparent</style>
		<autoSelect> <false /> </autoSelect>
		<showLines> <false /> </showLines>
		<wideMargins> <true /> </wideMargins>
		<multipleLines> <false /> </multipleLines>
		<reservedFamily> 0 </reservedFamily>
		<titleWidth>0</titleWidth>
		<icon>0</icon>
		<textAlign>center</textAlign>
		<font>Helvetica</font>
		<textSize>12</textSize>
		<textStyle>plain</textStyle>
		<textHeight>16</textHeight>
		<name>Tag Player</name>
		<script></script>
	</part>
	<name>Content</name>
	<script>∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞
What is HyperCard?
Version 1.0

©Copyright 1993 by Apple Computer,Inc.
All Rights Reserved.

Created by Instructional Products at Apple Computer, Inc.
Vers. 1.0 by Pat Chaney, Eli Cochran, Pete Harbeson, and Sarah McGranaghan
∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞

-- B A C K G R O U N D  S C R I P T
-- "--∆" indicates strings which need to be localized.

------  SYSTEM MESSAGES  ------

on openStack
checkHCversion
showTextFields
choose browse tool
set the editBkgnd to false
end openStack

on closeStack
lock screen
set the hilite of bkgnd btn "Welcome" to true
end closeStack

on resumeStack
choose browse tool
set the editBkgnd to false
end resumeStack

on openCard
-- enable/disable naviagation buttons
get the number of this card
set the enabled of bkgnd btn "Previous" to NOT (it = 1)
set the enabled of bkgnd btn "Next" to NOT (it = the number of cards)
-- hilight the topic button
get the short name of this card
if there is a bkgnd btn it
then set the hilite of bkgnd btn it to true
end openCard

on arrowKey whichArrow
if whichArrow is "Right" OR whichArrow is "Down" then
click at the loc of bkgnd btn "Next"
else if whichArrow is "Left" OR whichArrow is "Up" then
click at the loc of bkgnd btn "Previous"
end if
end arrowKey

on goTopic
go card (the short name of the target)
end goTopic

on checkHCVersion
if the version &lt; 2.2 then
requiresTwoTwoMessage
lock messages
if the number of lines in the stacks &gt; 1 then close card window
else go back
exit to HyperCard
end if
end checkHCVersion

on requiresTwoTwoMessage -- ∆ Localize the string.
answer "“" &amp; the short name of this stack &amp; "”" &amp;&amp; ¬
"requires version 2.2 of HyperCard or the HyperCard Player." &amp;&amp; ¬
"(You’re using version" &amp;&amp; the version &amp; ".)"
end requiresTwoTwoMessage

on showTextFields
get (the environment is "Development")
set the visible of fld "Body Dev" to it
set the visible of fld "Tag Dev" to it
set the visible of fld "Body Player" to not it
set the visible of fld "Tag Player" to not it
end showTextFields</script>
</background>
I'm going to look around at whatever content management / xml / json formats have been used for storing stack / card representation in CMS / version control. There's a stack I got somewhere that converts card layout to HTML web pages, might be good to take a look at as well.
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Card XML? Stackimport schema for OXT?

Post by xAction »

JSON is the logical replacement for XML
Here's that first XML you posted converted to JSON

Code: Select all

{
  "stack": {
    "name": "Resources.stak",
    "id": -1,
    "cardCount": 10,
    "cardID": 2992,
    "listID": 5972,
    "cantModify": {
      "false": ""
    },
    "cantDelete": {
      "false": ""
    },
    "cantAbort": {
      "false": ""
    },
    "cardSize": {
      "width": 480,
      "height": 296
    },
    "script": "∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\nWhat is HyperCard?\nVersion 2.3\n\n©Copyright 1993-1995 by Apple Computer,Inc.\nAll Rights Reserved.\n\nCreated by Instructional Products at Apple Computer, Inc.\nVers. 1.0 by Pat Chaney, Eli Cochran, Pete Harbeson, and Sarah McGranaghan\n∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\n\n-- S T A C K  S C R I P T\n-- THE SCRIPTS FOR THIS STACK ARE IN THE BACKGROUND SCRIPT AND\n-- SOME OF THE BACKGROUND OBJECTS",
    "background": "",
    "card": [
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      ""
    ]
  }
}
Second exmaple

Code: Select all

{
  "card": {
    "id": 6449,
    "filler1": 0,
    "bitmap": "BMAP_7989.pbm",
    "cantDelete": {
      "false": ""
    },
    "showPict": {
      "true": ""
    },
    "dontSearch": {
      "false": ""
    },
    "owner": 2619,
    "link": "",
    "part": {
      "id": 2,
      "type": "button",
      "visible": {
        "true": ""
      },
      "reserved5": 0,
      "reserved4": 0,
      "reserved3": 0,
      "reserved2": 0,
      "reserved1": 0,
      "enabled": {
        "true": ""
      },
      "rect": {
        "left": 284,
        "top": 265,
        "right": 314,
        "bottom": 291
      },
      "style": "opaque",
      "showName": {
        "false": ""
      },
      "highlight": {
        "false": ""
      },
      "autoHighlight": {
        "true": ""
      },
      "sharedHighlight": {
        "true": ""
      },
      "family": 0,
      "titleWidth": 0,
      "icon": 10381,
      "textAlign": "center",
      "font": "Chicago",
      "textSize": 12,
      "textStyle": "plain",
      "name": "Next",
      "script": "on mouseUp\ngo Home\nend mouseUp"
    },
    "content": [
      {
        "layer": "background",
        "id": 24,
        "text": {
          "span": [
            "hat's Next",
            "You’re ready to start exploring HyperCard stacks! \n\nYour Home stack is a good place to start exploring. \nTo go Home, click the Home button at the bottom of this card.\n\nIf you want to stop using HyperCard for now, choose Quit HyperCard from the File menu."
          ]
        }
      },
      {
        "layer": "background",
        "id": 26,
        "text": "What's Next\n\nYou’re ready to start exploring HyperCard stacks! \n\nYour Home stack is a good place to start exploring. \nTo go Home, click the Home button at the bottom of this card.\n\nIf you want to stop using HyperCard for now, choose Quit HyperCard from the File menu."
      }
    ],
    "name": "What's Next",
    "script": ""
  }
}
The fourth example, because the third was CSS

Code: Select all

{
  "background": {
    "id": 2619,
    "filler1": 0,
    "bitmap": "BMAP_4001.pbm",
    "cantDelete": {
      "false": ""
    },
    "showPict": {
      "true": ""
    },
    "dontSearch": {
      "false": ""
    },
    "link": "",
    "part": [
      {
        "id": 24,
        "type": "field",
        "visible": {
          "false": ""
        },
        "dontWrap": {
          "false": ""
        },
        "dontSearch": {
          "false": ""
        },
        "sharedText": {
          "false": ""
        },
        "fixedLineHeight": {
          "false": ""
        },
        "autoTab": {
          "false": ""
        },
        "lockText": {
          "true": ""
        },
        "rect": {
          "left": 121,
          "top": 3,
          "right": 477,
          "bottom": 262
        },
        "style": "transparent",
        "autoSelect": {
          "false": ""
        },
        "showLines": {
          "false": ""
        },
        "wideMargins": {
          "true": ""
        },
        "multipleLines": {
          "false": ""
        },
        "reservedFamily": 0,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "left",
        "font": "Palatino",
        "textSize": 14,
        "textStyle": "plain",
        "textHeight": 18,
        "name": "Body Player",
        "script": ""
      },
      {
        "id": 1,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 6,
          "right": 114,
          "bottom": 28
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "true": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Welcome",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 4,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 32,
          "right": 114,
          "bottom": 54
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Introduction",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 13,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 58,
          "right": 114,
          "bottom": 80
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "HyperCard",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 14,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 240,
          "right": 114,
          "bottom": 262
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "What's Next",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 15,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 84,
          "right": 114,
          "bottom": 106
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Stacks",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 16,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 110,
          "right": 114,
          "bottom": 132
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Cards",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 17,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 136,
          "right": 114,
          "bottom": 158
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Buttons",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 18,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 162,
          "right": 114,
          "bottom": 184
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Home",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 19,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 188,
          "right": 114,
          "bottom": 210
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "More Stacks",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 20,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 6,
          "top": 214,
          "right": 114,
          "bottom": 236
        },
        "style": "transparent",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 1,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "N Helvetica Narrow",
        "textSize": 14,
        "textStyle": "plain",
        "name": "Creating Stacks",
        "script": "on mouseUp\ngoTopic\nend mouseUp"
      },
      {
        "id": 21,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "false": ""
        },
        "rect": {
          "left": 124,
          "top": 266,
          "right": 152,
          "bottom": 290
        },
        "style": "opaque",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 0,
        "titleWidth": 0,
        "icon": 19858,
        "textAlign": "center",
        "font": "Chicago",
        "textSize": 12,
        "textStyle": "plain",
        "name": "Previous",
        "script": "on mouseUp\ngoPrev\nend mouseUp\n\non goPrev\ngo previous card\nend goPrev"
      },
      {
        "id": 22,
        "type": "button",
        "visible": {
          "true": ""
        },
        "reserved5": 0,
        "reserved4": 0,
        "reserved3": 0,
        "reserved2": 0,
        "reserved1": 0,
        "enabled": {
          "true": ""
        },
        "rect": {
          "left": 446,
          "top": 266,
          "right": 474,
          "bottom": 290
        },
        "style": "opaque",
        "showName": {
          "false": ""
        },
        "highlight": {
          "false": ""
        },
        "autoHighlight": {
          "true": ""
        },
        "sharedHighlight": {
          "true": ""
        },
        "family": 0,
        "titleWidth": 0,
        "icon": 30394,
        "textAlign": "center",
        "font": "Chicago",
        "textSize": 12,
        "textStyle": "plain",
        "name": "Next",
        "script": "on mouseUp\ngoNext\nend mouseUp\n\non goNext\ngo next card\nend goNext"
      },
      {
        "id": 26,
        "type": "field",
        "visible": {
          "true": ""
        },
        "dontWrap": {
          "false": ""
        },
        "dontSearch": {
          "false": ""
        },
        "sharedText": {
          "false": ""
        },
        "fixedLineHeight": {
          "false": ""
        },
        "autoTab": {
          "false": ""
        },
        "lockText": {
          "true": ""
        },
        "rect": {
          "left": 121,
          "top": 3,
          "right": 477,
          "bottom": 262
        },
        "style": "transparent",
        "autoSelect": {
          "false": ""
        },
        "showLines": {
          "false": ""
        },
        "wideMargins": {
          "true": ""
        },
        "multipleLines": {
          "false": ""
        },
        "reservedFamily": 0,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "left",
        "font": "Palatino",
        "textSize": 14,
        "textStyle": "plain",
        "textHeight": 18,
        "name": "Body Dev",
        "script": ""
      },
      {
        "id": 25,
        "type": "field",
        "visible": {
          "true": ""
        },
        "dontWrap": {
          "false": ""
        },
        "dontSearch": {
          "false": ""
        },
        "sharedText": {
          "false": ""
        },
        "fixedLineHeight": {
          "false": ""
        },
        "autoTab": {
          "false": ""
        },
        "lockText": {
          "true": ""
        },
        "rect": {
          "left": 121,
          "top": 199,
          "right": 477,
          "bottom": 257
        },
        "style": "transparent",
        "autoSelect": {
          "false": ""
        },
        "showLines": {
          "false": ""
        },
        "wideMargins": {
          "true": ""
        },
        "multipleLines": {
          "false": ""
        },
        "reservedFamily": 0,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "Helvetica",
        "textSize": 12,
        "textStyle": "plain",
        "textHeight": 16,
        "name": "Tag Dev",
        "script": ""
      },
      {
        "id": 27,
        "type": "field",
        "visible": {
          "false": ""
        },
        "dontWrap": {
          "false": ""
        },
        "dontSearch": {
          "false": ""
        },
        "sharedText": {
          "false": ""
        },
        "fixedLineHeight": {
          "false": ""
        },
        "autoTab": {
          "false": ""
        },
        "lockText": {
          "true": ""
        },
        "rect": {
          "left": 121,
          "top": 199,
          "right": 477,
          "bottom": 257
        },
        "style": "transparent",
        "autoSelect": {
          "false": ""
        },
        "showLines": {
          "false": ""
        },
        "wideMargins": {
          "true": ""
        },
        "multipleLines": {
          "false": ""
        },
        "reservedFamily": 0,
        "titleWidth": 0,
        "icon": 0,
        "textAlign": "center",
        "font": "Helvetica",
        "textSize": 12,
        "textStyle": "plain",
        "textHeight": 16,
        "name": "Tag Player",
        "script": ""
      }
    ],
    "name": "Content",
    "script": "∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\nWhat is HyperCard?\nVersion 1.0\n\n©Copyright 1993 by Apple Computer,Inc.\nAll Rights Reserved.\n\nCreated by Instructional Products at Apple Computer, Inc.\nVers. 1.0 by Pat Chaney, Eli Cochran, Pete Harbeson, and Sarah McGranaghan\n∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\n\n-- B A C K G R O U N D  S C R I P T\n-- \"--∆\" indicates strings which need to be localized.\n\n------  SYSTEM MESSAGES  ------\n\non openStack\ncheckHCversion\nshowTextFields\nchoose browse tool\nset the editBkgnd to false\nend openStack\n\non closeStack\nlock screen\nset the hilite of bkgnd btn \"Welcome\" to true\nend closeStack\n\non resumeStack\nchoose browse tool\nset the editBkgnd to false\nend resumeStack\n\non openCard\n-- enable/disable naviagation buttons\nget the number of this card\nset the enabled of bkgnd btn \"Previous\" to NOT (it = 1)\nset the enabled of bkgnd btn \"Next\" to NOT (it = the number of cards)\n-- hilight the topic button\nget the short name of this card\nif there is a bkgnd btn it\nthen set the hilite of bkgnd btn it to true\nend openCard\n\non arrowKey whichArrow\nif whichArrow is \"Right\" OR whichArrow is \"Down\" then\nclick at the loc of bkgnd btn \"Next\"\nelse if whichArrow is \"Left\" OR whichArrow is \"Up\" then\nclick at the loc of bkgnd btn \"Previous\"\nend if\nend arrowKey\n\non goTopic\ngo card (the short name of the target)\nend goTopic\n\non checkHCVersion\nif the version &lt; 2.2 then\nrequiresTwoTwoMessage\nlock messages\nif the number of lines in the stacks &gt; 1 then close card window\nelse go back\nexit to HyperCard\nend if\nend checkHCVersion\n\non requiresTwoTwoMessage -- ∆ Localize the string.\nanswer \"“\" &amp; the short name of this stack &amp; \"”\" &amp;&amp; ¬\n\"requires version 2.2 of HyperCard or the HyperCard Player.\" &amp;&amp; ¬\n\"(You’re using version\" &amp;&amp; the version &amp; \".)\"\nend requiresTwoTwoMessage\n\non showTextFields\nget (the environment is \"Development\")\nset the visible of fld \"Body Dev\" to it\nset the visible of fld \"Tag Dev\" to it\nset the visible of fld \"Body Player\" to not it\nset the visible of fld \"Tag Player\" to not it\nend showTextFields"
  }
}
Via this Converter
A comparison of pros and cons between the two (there's hundreds of these online )

rayLib's JSON file imported into a stack custom property array super easy.

Get the JSON

Code: Select all

on mouseUp pMouseButton
   local tFile, tData, tArray
   answer file "Choose a JSON file to load" with type "JSON|json|JSON"
   if the result is not "cancel" then
      put it into tFile
      put url ("file:" & tFile) into tData
      put JSONToArray(tData) into tArray
   end if
set the rayLibArray of this stack to tArray
end mouseUp
Display in TreeView

Code: Select all

on mouseUp
put the rayLibArray of this stack into tArray
set the arraydata of widget "Tree View" to tArray
end mouseUp
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

xAction wrote: Thu Nov 18, 2021 9:10 am JSON is the logical replacement for XML
Is it though? I don't think so! For starters, it's certainly NOT as human-readable as XML tagged data. Keep in mind, I'm not saying that I'm against using JSON or converting back and forth between the two. Just that I like the human readability of XML style tagging and xTalk is all about us mere mortal humans, right? And XML is just as easily parsed directly into Array in the IDE (JSON is too). XML can be easily created using any old text editor. Most importantly, XML is eXtensible! Which let's us be agile in adding new tags and or help in tags to ignore for things that aren't implemented by our theoretical parser.

Take those reserved tags for example, they're only there because of bit fields that were present in the data fork* of HyperCard's binary stack format (* in macOS classic, and actually up to present day macOS even though it's long been deprecated, files can have a data fork AND a special resource fork where assets like icons and sounds are stored).
As far as anyone knows those Reserved bits were never implemented for anything by HyperCard (the file format has been throughly reverse engineered but some elements are still unknown), but let's say if someone discovers that in in a HyperCard 3.0 beta those were implemented and actually meant something, then we could add those fields to reimplement them or decide to just continue to ignoring those tags.

Also, HTML is XML, I don't think that's going away anytime soon. Having our own xTalk XML tagging system could help facilitate conversions such as <STACK><->WebSite, <CARD><->WebPage, and maybe even something like <XTSCRIPT><->Transpiled-JavaScript (or any other sort of language for that matter)!

Take this snippet from one of those examples:

Code: Select all

    "script": "∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\nWhat is HyperCard?\nVersion 2.3\n\n©Copyright 1993-1995 by Apple Computer,Inc.\nAll Rights Reserved.\n\nCreated by Instructional Products at Apple Computer, Inc.\nVers. 1.0 by Pat Chaney, Eli Cochran, Pete Harbeson, and Sarah McGranaghan\n∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞∞\n\n-- S T A C K  S C R I P T\n-- THE SCRIPTS FOR THIS STACK ARE IN THE BACKGROUND SCRIPT AND\n-- SOME OF THE BACKGROUND OBJECTS",
    "background": "",
    "card": [
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      ""
    ]
  }
}
I have no idea what all of those "", lines are? Are they empty card properties? If they are then I might want to fill them in with my defaults or override certain properties with a custom set.

Now I realize that XML is much more verbose and creates more data from the same source data, but these days I don't think it's all that significant of a size difference (most people aren't using dial-up modems anymore), and IMO the benefits of human readability far out weighs the data transfer costs of a few bytes or even Kbytes larger data. Then again if you only need a few tags, card, field, text, image box, and not a full set of every property that applies to those object types, then XML might actually be smaller or at least not much larger byte wise.

But I could also see a situation where you need to download a big batch of these stack.xml,card.xml, etc. files where some minified JSON might be worth doing for data transfer, but I'd prefer that those JSON then get converted to a human readable, text editor friendly format for saving to local storage.
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Card XML? Stackimport schema for OXT?

Post by xAction »

I don't find XML human readable AT ALL, I've avoided even looking at that garbage for 20 years. It's nauseating.

These blank lines at the end of the JSON conversion were because the end of that first example did NOT follow the standard XML formula of

Code: Select all

<label>Text</label>
so the XML to JSON converter just ignored it.

Code: Select all

 "background": "",
    "card": [
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      "",
      ""
    ]
  }
}
What's he doing here? Making his own non standard HTML or some CSS?

Code: Select all

<background id="2619" file="background_2619.xml" name="Content" />
	<card id="2992" file="card_2992.xml" marked="false" name="Welcome" owner="2619" />
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

Probably time to take a closer look at that app framework called Levure that Trevor DeVore has been developing for a long time.
https://github.com/trevordevore/levure

Ah that's right he uses YAML in that, I guess that's an option that could be used for Resource indexing as well.
It's got the readability of XML but YML is less verbose.
Example:
https://github.com/trevordevore/levure/ ... s/app.yml

Saving a link to this XML to Script-Array script here:
https://gist.github.com/trevordevore/5584753
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

xAction wrote: Thu Nov 18, 2021 3:02 pm I don't find XML human readable AT ALL, I've avoided even looking at that garbage for 20 years. It's nauseating.
I feel the same way about JSON, particularly 'minified' JSON that looks like a big jumbled up mess, although I do recognize the utility of it.

I suppose formatting errors can happen with either, but I think it's far easier to spot with XML.
What's he doing here? Making his own non standard HTML or some CSS?

Code: Select all

<background id="2619" file="background_2619.xml" name="Content" />
	<card id="2992" file="card_2992.xml" marked="false" name="Welcome" owner="2619" />
Keep in mind that XML this IS NOT a LiveCode stack, it's converted from a HyperCard 2.x stack.

That's a background card (which would be a group with background behavior in LC) with the numeric ID "2619" (which we could maybe just ignore?), this background group would be named "Content" and would be place on the card with the numeric ID "2992", that card is described in the file card_2992.xml, it's not a marked card (not sure if LC supports the HC "Marked" card attribute), the card is named "Welcome" and it's owned(?) by background ID "2619" (not sure if this is relevant to LCC / OXT? Or perhaps it's the equivalent of the group ID# for the background behavior group?)
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

I suppose it could be possible to mix and match? I see there is still some XML in that parsed to JSON, I would think you could have JSON embedded into an XML tag as well. Or there's YML, could be a happy medium, that seems to solve the readability issue for me while being a bit less verbose than XML.

The main thing is I'd like to have some sort text-based system of tagged data that can be parsed to programmatically create a stack, card, fields, buttons, etc. UI.

This one by StackImporter already exists as xml and could be used right now to convert 3000+ stacks on archive.org, or the 100s of stacks I still have on my hard drive, into xml + media assets, and on all platforms that the IDE runs on! I realize this may be a niché concern, but it's one that would clearly differentiate OXT from LCC. And of course XML being eXtensible, we could add or ignore tags in that format, covert it back and forth to JSON,YML, etc. maybe even HTML or ScriptOnly stack.

Would need to write a parser to pull those into OXT (while also dealing with several small issues that make HC & LC just slightly incompatible) as Cards, Buttons, Fields, Images, etc. We would need to have the same for a compatible JSON or YML version of the format.
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

There's like..HUNDREDS of stacks on the revshare thing that aren't being used, and untold numbers of them that don't work. What is the value of having thousands of old hypercard stacks? I haven't had to open a Hypercard stack since 1994.
Oh I see what you'r after, lol.
You can run that right on archive.org in the browser...
FourthWorld
Posts: 280
Joined: Sat Sep 11, 2021 4:37 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by FourthWorld »

Latency being the key bottleneck in modern networked systems, MongoDB uses a compact binary variant of the JSON serialization format, BSON.

LiveCode has a compact binary serialized representation, thoroughly tested, robust, and efficient: stack files.

XML is an interoperability format. When there is a need to exchange LiveCode stack objects with non-LiveCode systems that will become useful. Is that the case with an in-app extensions manager?

As for legacy stuff, consider:

PHP predates Node.js by about 16 years, yet the Node.js repos have about 40% more packages, and twice the traffic.

Newer stuff is more valuable for making new stuff.

Life is short, software life cycles even shorter. Prioritization is essential for good living.
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

Have you seen webcard?
And ViperCard?
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

FourthWorld wrote: Thu Nov 18, 2021 6:46 pm Latency being the key bottleneck in modern networked systems, MongoDB uses a compact binary variant of the JSON serialization format, BSON.
LiveCode has a compact binary serialized representation, thoroughly tested, robust, and efficient: stack files.

XML is an interoperability format. When there is a need to exchange LiveCode stack objects with non-LiveCode systems that will become useful. Is that the case with an in-app extensions manager?
Network latency ... this wouldn't need a network at all, binary resources, sounds, images, fonts, could be embedded in a common standard way such as b64 or .uu in an inline tag making the entire thing as portable as possible, and in a open standard format that a person could parse manually if needed. Perhaps this person just want to extract the first image elements from each card in a stack, for a Preview image of the card's contents, their custom parsing function would then just pull the first <Image> tag it finds in a each <CARD> in the XML and then extract (or maybe downloads from URL) that image from each, and returns a list of <Images> for display in the rest of their script.

Yes LiveCode has a format that LiveCode opens and does stuff with. This would be another format, one that could be created with a text editor, actually there's a bunch of whole numbered versions of that format.
As for legacy stuff, consider:

PHP predates Node.js by about 16 years, yet the Node.js repos have about 40% more packages, and twice the traffic.

Newer stuff is more valuable for making new stuff.

Life is short, software life cycles even shorter. Prioritization is essential for good living.
Agreed, life is short, but hopefully I got maybe another 20+years left in me. Anyway, THIS WOULD NOT BE A PRIORITY as far as feature aspect of OXT, this would be a working standardization, and group occasionally discussing the idea.

As an experiment I'm planing on trying to use ResourceManager as some sort of a small scale system using a STAKXTML based template system, just making up valid tags for things I need along the way.

Making a standard ISN'T solely about LiveCode, nor retro HyperCard stacks (some of which can't be found on Archive.org and contain useful information on topics that are still relevant 30 years later, yes including some guide to Naturism or whatever which would be relevant to someone into that (WHO AM I TO JUDGE?).

It's about the interoperability AND MORE, a template system with mechanism(s) that can read it to generate a stack from it.

For example, I could have a template that's just a square stack, with one card, with some screenshot image at the top, a text description blurb Fld, a button below to return to "Home" stack (which now redirects opening my custom StartCenter). The XML might look something like this:

Code: Select all

<STACK rect=0,0,480,480 name="ResourceCenterTemplate">
   <CARD darkmodeTheme=true rect=20,20,460,460>
      <FIELD name="DescriptionBlurb">
          <TEXT RelativeURL="./description.txt"></TEXT>
      </FIELD>
      <BUTTON name="GoHome" showName=true rect=20,460,20,460>
          <XTSCRIPT>
                 on MouseDown
                        go stack "Home"
                 end MouseDown
          <XTSCRIPT>
      </BUTTON>
    </CARD>
</STACK>
In this use case it's entirely unimportant that the same layout would be recreatable by HyperCard or MetaCard of the 90s on a 14 inch CRT monitor at 16bit color and 72ppi, from the same markup.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

I suppose I could use for my layout XML, Adobe InDesign's IDML xml scheme, which is primarily used by users for converting layouts between versions of their own product, InDesign, providing backward compatibility with older versions of ID!

Using IDML would allow me to use Adobe InDesign to layout Stacls/Cards in a professional page layout program....

But where's the fun in that? I'd much rather bring some better page layout features to OXT.

I want... no the world NEEDS, an open STAK/CARD/BTN/FLD/xTscript markup standard.

Maybe if Apple's xTalk standardizing group had seriously discussed it in late 1980s, we'd be talking about how "<WILDCARDML> has a stranglehold on the browser", instead of "how can we make this work inside of <HTML>".
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

Using IDML would allow me to use Adobe InDesign to layout Stacls/Cards in a professional page layout program....

Well...because you could pusth OpenXTalk to the adobe user crowd and say "Make DESKTOP Apps directly from your indesign pages." This would interest a small subset of designers who have business come to them and say "Design us a UI for our machine, kiosk, whatever"...then they take that UI and some poor bastard programmer has to recreate it from a mess of PNG files.

If we get some useful web capability they they could spit out decent web apps as well.

If you have access to IDML, it's worth a shot to write a script or two that reads a page layout and produces a stack. Post that code to Github, develop it here and there as time permits. Shop it around some designer subreddit/Adobe forum get people to create use cases.
But where's the fun in that? I'd much rather bring some better page layout features to OX
Seriously, a super easy to script page layout app? It's 30 years long past due.

Scribus files are XML btw. Here's a scribus file with some objects.
SCRIBUS_Objects.zip
(6.1 KiB) Downloaded 244 times
It's got javascript buttons, menus, and lists in the page layouts for use in PDFs.
It's scriptable via Python
Germany just switched 25,000 government computers to LibreOffice and other open source solutions.
Sprechen Sie Deutsch?
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

xAction wrote: Sat Nov 20, 2021 7:16 pm
Using IDML would allow me to use Adobe InDesign to layout Stacls/Cards in a professional page layout program....

Well...because you could pusth OpenXTalk to the adobe user crowd and say "Make DESKTOP Apps directly from your indesign pages." This would interest a small subset of designers who have business come to them and say "Design us a UI for our machine, kiosk, whatever"...then they take that UI and some poor bastard programmer has to recreate it from a mess of PNG files.

If we get some useful web capability they they could spit out decent web apps as well.

If you have access to IDML, it's worth a shot to write a script or two that reads a page layout and produces a stack. Post that code to Github, develop it here and there as time permits. Shop it around some designer subreddit/Adobe forum get people to create use cases.
But where's the fun in that? I'd much rather bring some better page layout features to OX
Seriously, a super easy to script page layout app? It's 30 years long past due.

Scribus files are XML btw. Here's a scribus file with some objects.
SCRIBUS_Objects.zip
It's got javascript buttons, menus, and lists in the page layouts for use in PDFs.
It's scriptable via Python
Germany just switched 25,000 government computers to LibreOffice and other open source solutions.
Sprechen Sie Deutsch?
Now ya feeling' me Bruv!

I could see use as a general UI design tool, use for prototyping web app with UI that runs on _hyperscript, JS freely intermixed and using some web 3.0 JS library lib directly from an xTalk script, perhaps that's all running on React Native with access to Operating System API capabilities!

It's about being OPEN to possibilities, I mean it is OPEN XTalk right!

Drop the STAKML on a converter and it's spits out the same layout, in HTML, IDML, Scribdus XML, whatever.

Then some poor schlub in PrePress has to try to get that CardML -> IDML xml and those super low res 72dpi PNG, 32x32px Index color GIF, and some overly compressed JPEG photos to somehow look decent at 300dpi at a minimum, to use it in the InDesign for a ad campaign 24x18 inch Poster (Yup, I've been on the receiving end of similar scenario in RL )!
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

Is DPI still an issue with digital printing and all that AI uprezzing that's available? I thought we'd be past that by now.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

xAction wrote: Sat Nov 20, 2021 11:14 pm Is DPI still an issue with digital printing and all that AI uprezzing that's available? I thought we'd be past that by now.
I don't understand the question, digital images are not analog, not continuous tone, so it's like you're asking me "is adding non-existent resolution to a pixel based image still an issue?" Is digital sound equal to analog sound? No, but depending on the sample size, depth, rate, playback decoder, etc. it can sound pretty damn close, or it could be sampled at 8bit mono with tons of lossy compression applied, which no amount of EQ would help sound much better. It's analogous to that for digital images sampling. It's always going to be an issue when the people making the files don't understand these things. If you want a 500x1000 pixel image to look good imaged at 2400 dots per inch on a 18x24 inches poster, it's not going to, it will look super pixelated or blurry as hell from massive antialiasing, even with all the tricks applied and stochastic screening to try to hide the jaggies.

If youre talking about vector art, that's different vector based (Adobe Illustrator, PostScript) Bézier curves and such were ALWAYS resolution independent, even back in the 80s. Vector based (like postscript or SVG) is analogous to MIDI for sound, it's not actually an image until it gets interpreted as one. MIDI isn't actually sound until the performance data is interpreted into one by a playback engine.

Conversely it's a skill in itself going in either direction, reducing image resolution to smaller size and still having an image look OK... I mean YOU try making an OXT icon that looks great at 32px x 32px! Details turn into a pixel blob!
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

reading this thread again, no I had not seen WebCard before. That's very interesting.

https://webcard.herokuapp.com/documents/
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

WebCard is kind of a a nice engine, HyperCard rebuild that runs on Node.JS (and therefore can run on all architectures that Node runs on!) It has some things a lot of basic HyperCard Clones don’t bother with like “start using stack” for library stacks. This could be made into a monster. It’s AGPL3 license… I think I’m going to do a pull request to add “top” as an exit to HyperCard synonym, maybe we can get a line of communication / cooperation going on with this project.

Even with its IDE running in a browser, WebCard still opens a separate window for some windows.
Screen Shot 2021-11-22 at 9.12.30 PM.png
Screen Shot 2021-11-22 at 9.12.30 PM.png (956.52 KiB) Viewed 8551 times
But LOOK, Interactive Music with the playSentence for of the play command, built right in, noice!
xAction
Posts: 282
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by xAction »

But LOOK, Interactive Music with the playSentence for of the play command, built right in, noice!
Lol, Christmas came early for you.
User avatar
OpenXTalkPaul
Posts: 1485
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: Stack/Card XML? Stackimport schema for OXT?

Post by OpenXTalkPaul »

So ViperCard has yet another serialization of a stack format, in this one parts or controls are just called <elements> but it’s the same sort of thing. I want to have a try at something to convert back and forth between some or all of these different stack serialization formats, it may not be that difficult since they’re all basically based on the same thing.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests