This project has moved. For the latest updates, please go here.

XSD dependencies affecting path length?

Topics: Questions
Apr 5, 2013 at 4:23 PM
Edited Apr 5, 2013 at 5:43 PM
Hi,

Thanks for your efforts on this tool. I've been trying to get it to work (I'm new to sandcastle) and I have a question for you:

I have 5 XSD files in the set, and I get the below error when building. Four of them have "imports" to other XSDs in the set. The error does not mention which file.

However, if I only specify one of the XSD files (one with no imports specified in it), it works without error.

Any ideas?

(Also - how can I use the plug-in without any SHFB "documentation sources" specified - I just want docs generated for the XSDs?)

SHFB: Error BE0029: Unexpected error while executing plug-in 'XML Schema Documenter': XsdDocumentation.XsdDocumentationException: There was an error constructing the schema set. ---> System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
at System.IO.PathHelper.Append(Char value)
at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength)
at System.IO.Path.GetDirectoryName(String path)
at XsdDocumentation.Model.XmlSchemaSetBuilder.Build(IEnumerable`1 schemaFileNames)
at XsdDocumentation.Model.SchemaSetManager.Initialize()
--- End of inner exception stack trace ---
at XsdDocumentation.Model.SchemaSetManager.Initialize()
at XsdDocumentation.Model.Context..ctor(IMessageReporter messageReporter, Configuration configuration)
at XsdDocumentation.Model.ContentGenerator..ctor(IMessageReporter messageReporter, Configuration configuration)
at XsdDocumentation.PlugIn.XsdPlugIn.Execute(ExecutionContext executionContext)
at SandcastleBuilder.Utils.BuildEngine.BuildProcess.ExecutePlugIns(ExecutionBehaviors behavior)
There was an error constructing the schema set.
The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
Apr 8, 2013 at 3:59 PM
Edited Apr 23, 2013 at 10:29 AM
Ok, I solved this by a small but significant change in the import tag's schemaLocation attribute

<xs:import namespace="http://www.xxxxx.com/App/DataContracts/Booking/Bookings/v1.0" schemaLocation=".\Booking.DataContracts.Bookings.xsd"/>
modified to this:
<xs:import namespace="http://www.xxxxx.com/App/DataContracts/Booking/Bookings/v1.0" schemaLocation="Booking.DataContracts.Bookings.xsd"/>

It now builds the help file after the change to all schemaLocation values. However, clicking on links using the a referenced XSD only work if you click on the left hand tree menu.

If you click any links to a e.g. complex type defined in a different XSD, you get a 404 error...

Any ideas?

M
Coordinator
Apr 14, 2013 at 2:44 AM
Hi Michael,

Can you share the schema files? In that case I could debug the issue.

If you want to to understand what's going on, you can have a look at the code here. In essence, the code computes the transitive closure of all XSD files, starting from the ones you configured. If the path in the referencing schema is relative, it combines the path with the directory of the schema file that points to it. In your case, one of the schema files in the closure exceeds the Windows path limitation.

The only real fix is to make sure the closure of all schema files have a fully qualified path that is less than or equal to 260 characters.

Thanks,
-Immo
Apr 23, 2013 at 4:15 PM
Hi, thanks for your answer - it makes sense. The solution was literally just removing the .\ from the beginning of the schemaLocation value. The path stayed relative.

I actually ran into a different problem after that. It seems that the URLs generated for the same element are different for the treeview and the content pane.

e.g. from the content pane, a URL for a particualr schema is (and gives a 404 not found response):
http://pscbizt01101.devint.ad.insidemedia.net/html/60b3984c-e927-654c-00c6-2ab2c8f962dc.htm

but navigating to the schema with the treeview uses this URL:
http://pscbizt01101.devint.ad.insidemedia.net/BizTalkbookingservicehelpdocs/html/60b3984c-e927-654c-00c6-2ab2c8f962dc.htm

It seems the Vdir name is being left out?
Coordinator
Apr 24, 2013 at 2:34 AM
Interesting, I've never seen such a behavior. Where does the directory name BizTalkbookingservicehelpdocs come form? Is that the output location or does it come from the schema file location?

Also, what output are you generating? Is it a web site, a CHM, or an HXS?
Apr 24, 2013 at 9:42 AM
Sorry, I should've added that I am generating web site help.

The output location is a folder called DocsWeb, and BizTalkbookingservicehelpdocs is the name of the virtual directory in IIS that it is mapped to.
If I use the SHFB GUI to view the output instead (and it spins up the ASP.NET web server) I get the same issue.

It seems that any of the links for a leaf node, if clicked in the content pane, have the wrong path...

I can send you the test project I have?
Coordinator
Apr 25, 2013 at 4:32 PM
Yes please, I've contacted you via the CodePlex contact page. You can simply reply to it.

But set expectations: since I'm doing this in my spare time I'll probably don't have time before the weekend.

Thanks,
-Immo
Coordinator
May 3, 2013 at 4:49 PM
By the way: I haven't received a response so far -- did I miss any mails?

Thanks,
-Immo
Coordinator
May 5, 2013 at 7:33 PM
Edited Aug 31, 2013 at 9:38 PM
Thanks for sending the project. I was able to reproduce the problem. It's fixed in the latest release.

BTW: There seems to be an issue with the VS2010 presentation style. For example, the icons aren't showing up in all locations. I'll debug this at some other time.

For now, I'd change the presentation style to VS2005.

Thanks,
-Immo
Marked as answer by terrajobst on 2/15/2014 at 6:13 PM